Symptoms

Consider the following scenario:

  • You have some custom PowerShell scripts or modules that contain a reference to the built-in $MyInvocation instance.

  • You execute the scripts or modules on a Windows 8-based or Windows Server 2012-based computer by using Windows PowerShell 3.0.

  • Some objects are passed through a pipe.

In this scenario, the value of the $MyInvocation.MyCommand object is set to null. For example, the issue occurs when you run the following script:

$Line= Get-Content $file$Line | foreach-Object { write-host "** MYCOMMAND [2] IS NULL?: " ($MyInvocation.MyCommand -eq $null) " --->" $_}

Note This issue does not occur when you run the script by using Windows PowerShell 2.0.

Resolution

A supported hotfix is now available from Microsoft. However, it is intended to correct only the problem that this article describes. Apply it only to systems that are experiencing this specific problem.To resolve this problem, contact Microsoft Customer Support Services to obtain the hotfix. For a complete list of Microsoft Customer Support Services telephone numbers and information about support costs, visit the following Microsoft website:

http://support.microsoft.com/contactus/?ws=supportNote In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

PrerequisitesTo apply this hotfix, you must be running Windows 8 or Windows Server 2012.

Registry informationTo use the hotfix in this package, you do not have to make any changes to the registry.

Restart requirementYou must restart the computer after you apply this hotfix.

Hotfix replacement informationThis hotfix does not replace a previously released hotfix.

File information

The global version of this hotfix installs files that have the attributes that are listed in the following tables. The dates and the times for these files are listed in Coordinated Universal Time (UTC). The dates and the times for these files on your local computer are displayed in your local time together with your current daylight saving time (DST) bias. Additionally, the dates and the times may change when you perform certain operations on the files.

Windows 8 and Windows Server 2012 file information notesImportant Windows 8 hotfixes and Windows Server 2012 hotfixes are included in the same packages. However, only "Windows 8" is listed on the Hotfix Request page. To request the hotfix package that applies to one or both operating systems, select the hotfix that is listed under "Windows 8" on the page. Always refer to the "Applies To" section in articles to determine the actual operating system that each hotfix applies to.

  • The files that apply to a specific product, milestone (RTM, SPn), and service branch (LDR, GDR) can be identified by examining the file version numbers as shown in the following table:

    Version

    Product

    Milestone

    Service branch

    6.2.920 0.16 xxx

    Windows 8 and Windows Server 2012

    RTM

    GDR

    6.2.920 0.20 xxx

    Windows 8 and Windows Server 2012

    RTM

    LDR

  • GDR service branches contain only those fixes that are widely released to address widespread, critical issues. LDR service branches contain hotfixes in addition to widely released fixes.

  • The MANIFEST files (.manifest) and the MUM files (.mum) that are installed for each environment are listed separately in the "Additional file information for Windows 8 and Windows Server 2012" section. MUM and MANIFEST files, and the associated security catalog (.cat) files, are extremely important to maintain the state of the updated components. The security catalog files, for which the attributes are not listed, are signed with a Microsoft digital signature.

For all supported x86-based versions of Windows 8

File name

File version

File size

Date

Time

Platform

System.management.automation.dll

6.2.9200.16626

5,194,752

30-May-2013

00:53

x86

System.management.automation.dll

6.2.9200.20731

5,194,752

30-May-2013

06:01

x86

For all supported x64-based versions of Windows 8 and of Windows Server 2012

File name

File version

File size

Date

Time

Platform

System.management.automation.dll

6.2.9200.16626

5,194,752

30-May-2013

02:50

x86

System.management.automation.dll

6.2.9200.20731

5,194,752

30-May-2013

07:54

x86

To resolve this issue, install update rollup 2855336, or install the hotfix that is described in this article. This hotfix is also available at Microsoft Update Catalog.

Update informationFor more information about how to obtain update rollup 2855336, click the following article number to view the article in the Microsoft Knowledge Base:

2855336 Windows RT, Windows 8, and Windows Server 2012 update rollup: July 2013

Workaround

To work around this issue, do not use a pipe to pass the objects. For example, you can change the example script to the following:

$Line= Get-Content $fileforeach( $L in $Line){ write-host "** MYCOMMAND [2] IS NULL?: " ($MyInvocation.MyCommand -eq $null) " --->"$L }

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

More Information

For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates

Additional file information for Windows 8 and Windows Server 2012

Additional files for all supported x86-based versions of Windows 8

File name

Msil_system.management.automation_31bf3856ad364e35_6.2.9200.16626_none_996281338d2c68d2.manifest

File version

Not applicable

File size

1,718

Date (UTC)

30-May-2013

Time (UTC)

01:04

Platform

Not applicable

File name

Msil_system.management.automation_31bf3856ad364e35_6.2.9200.20731_none_82964ca5a6d2620a.manifest

File version

Not applicable

File size

1,718

Date (UTC)

30-May-2013

Time (UTC)

06:11

Platform

Not applicable

File name

X86_0069cc1d935f52105e189e37ad3d3c48_31bf3856ad364e35_6.2.9200.16626_none_732d49d23ba3aebb.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_04d1fcf53a2eb0f5a62016f97b15f4ab_31bf3856ad364e35_6.2.9200.16626_none_c69da1ec2767ada5.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_1241b0d382e6bf3603f61b64e9af862f_31bf3856ad364e35_6.2.9200.20731_none_097e5bed0bc97c91.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_14232bfddb283e4092dfb5e467b53539_31bf3856ad364e35_6.2.9200.20731_none_496bd00cd7224620.manifest

File version

Not applicable

File size

677

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_18071d4ee234e78661bfb10ae7841e2c_31bf3856ad364e35_6.2.9200.20731_none_3a821365d5cf0b19.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_1b665e9d1198a78d70cb14374324a46a_31bf3856ad364e35_6.2.9200.20731_none_264325cc294b6602.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_3967743f256fb2d2306a18cfc505b75a_31bf3856ad364e35_6.2.9200.16626_none_8d608ec4b43e9639.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_3b47115ead7f971f520a2c1834c813b0_31bf3856ad364e35_6.2.9200.20731_none_fd7012d742e52fd4.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_4af8e3ab66f40e7f6b8757610666efa0_31bf3856ad364e35_6.2.9200.20731_none_94f33e6b74af3453.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_512ded43940eb8acc29e99405fd6830f_31bf3856ad364e35_6.2.9200.16626_none_cef320d83bc0c870.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_5403ff2c90cb7ebccbebf8f061315748_31bf3856ad364e35_6.2.9200.16626_none_5e1e657c1146c0ee.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_686033d3aa0ee13b9a126d9e07846dcc_31bf3856ad364e35_6.2.9200.16626_none_a8095bc0f27be7be.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_7e76fd759f23ee430b19c9c856a9f795_31bf3856ad364e35_6.2.9200.16626_none_36b546445335ce76.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_97174141338aedb98e2288d2de0cf8f3_31bf3856ad364e35_6.2.9200.20731_none_99d384aed8907790.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_9af58ad204db7f5f3bac4409dff8aab7_31bf3856ad364e35_6.2.9200.20731_none_e0fa6c2c89023b18.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_9ef903158e981ef76408781d217dad44_31bf3856ad364e35_6.2.9200.20731_none_aee31af5c7623447.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_aaf311bbeb132fa091936d68798bb2bb_31bf3856ad364e35_6.2.9200.16626_none_6980ebae6781e062.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_b7d70cabd55d7536679e131da2bb22da_31bf3856ad364e35_6.2.9200.16626_none_180d68323a097f3a.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_bf14b3d5846f7c88f4af24011912827c_31bf3856ad364e35_6.2.9200.20731_none_3d4a21756ec54fb9.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_bf9348f555a3a94c1f6c5f0dc95f353b_31bf3856ad364e35_6.2.9200.16626_none_619d841c1882c600.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_ca1bc2fb2ef088a4efd46c51a82bde00_31bf3856ad364e35_6.2.9200.20731_none_ecfd141b9e37f93d.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_cd429c9e15ee381c26a5e0baf4827c83_31bf3856ad364e35_6.2.9200.16626_none_b30938dc97b031b4.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_df0cfec14a8238c163c13c58cc81a786_31bf3856ad364e35_6.2.9200.16626_none_521fa78c897a8660.manifest

File version

Not applicable

File size

677

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_df3ebc3a731bf6deb672200943c6478e_31bf3856ad364e35_6.2.9200.20731_none_3bb8c22416c8b2b6.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_e2c64b7dcfafaf4972521c5451fe0969_31bf3856ad364e35_6.2.9200.20731_none_887f185e8a562310.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_eec6c535ad67563dd8b8f6ac043dfe2b_31bf3856ad364e35_6.2.9200.20731_none_f6f2c548ec0797fa.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_f62187109141bad6db8b1238954791e1_31bf3856ad364e35_6.2.9200.16626_none_789c8cd06e1e9b9f.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

File name

X86_f84e3899861bc6b7dd8c4a426046ab50_31bf3856ad364e35_6.2.9200.16626_none_d8d8a6da48df9d24.manifest

File version

Not applicable

File size

685

Date (UTC)

30-May-2013

Time (UTC)

15:28

Platform

Not applicable

Additional files for all supported x64-based versions of Windows 8 and of Windows Server 2012

File name

Amd64_0069cc1d935f52105e189e37ad3d3c48_31bf3856ad364e35_6.2.9200.16626_none_cf4be555f4011ff1.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_04d1fcf53a2eb0f5a62016f97b15f4ab_31bf3856ad364e35_6.2.9200.16626_none_22bc3d6fdfc51edb.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_1241b0d382e6bf3603f61b64e9af862f_31bf3856ad364e35_6.2.9200.20731_none_659cf770c426edc7.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_14232bfddb283e4092dfb5e467b53539_31bf3856ad364e35_6.2.9200.20731_none_a58a6b908f7fb756.manifest

File version

Not applicable

File size

679

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_18071d4ee234e78661bfb10ae7841e2c_31bf3856ad364e35_6.2.9200.20731_none_96a0aee98e2c7c4f.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_1b665e9d1198a78d70cb14374324a46a_31bf3856ad364e35_6.2.9200.20731_none_8261c14fe1a8d738.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_3967743f256fb2d2306a18cfc505b75a_31bf3856ad364e35_6.2.9200.16626_none_e97f2a486c9c076f.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_3b47115ead7f971f520a2c1834c813b0_31bf3856ad364e35_6.2.9200.20731_none_598eae5afb42a10a.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_4af8e3ab66f40e7f6b8757610666efa0_31bf3856ad364e35_6.2.9200.20731_none_f111d9ef2d0ca589.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_512ded43940eb8acc29e99405fd6830f_31bf3856ad364e35_6.2.9200.16626_none_2b11bc5bf41e39a6.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_5403ff2c90cb7ebccbebf8f061315748_31bf3856ad364e35_6.2.9200.16626_none_ba3d00ffc9a43224.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_686033d3aa0ee13b9a126d9e07846dcc_31bf3856ad364e35_6.2.9200.16626_none_0427f744aad958f4.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_7e76fd759f23ee430b19c9c856a9f795_31bf3856ad364e35_6.2.9200.16626_none_92d3e1c80b933fac.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_97174141338aedb98e2288d2de0cf8f3_31bf3856ad364e35_6.2.9200.20731_none_f5f2203290ede8c6.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_9af58ad204db7f5f3bac4409dff8aab7_31bf3856ad364e35_6.2.9200.20731_none_3d1907b0415fac4e.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_9ef903158e981ef76408781d217dad44_31bf3856ad364e35_6.2.9200.20731_none_0b01b6797fbfa57d.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_aaf311bbeb132fa091936d68798bb2bb_31bf3856ad364e35_6.2.9200.16626_none_c59f87321fdf5198.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_b7d70cabd55d7536679e131da2bb22da_31bf3856ad364e35_6.2.9200.16626_none_742c03b5f266f070.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_bf14b3d5846f7c88f4af24011912827c_31bf3856ad364e35_6.2.9200.20731_none_9968bcf92722c0ef.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_bf9348f555a3a94c1f6c5f0dc95f353b_31bf3856ad364e35_6.2.9200.16626_none_bdbc1f9fd0e03736.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_ca1bc2fb2ef088a4efd46c51a82bde00_31bf3856ad364e35_6.2.9200.20731_none_491baf9f56956a73.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_cd429c9e15ee381c26a5e0baf4827c83_31bf3856ad364e35_6.2.9200.16626_none_0f27d460500da2ea.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_df0cfec14a8238c163c13c58cc81a786_31bf3856ad364e35_6.2.9200.16626_none_ae3e431041d7f796.manifest

File version

Not applicable

File size

679

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_df3ebc3a731bf6deb672200943c6478e_31bf3856ad364e35_6.2.9200.20731_none_97d75da7cf2623ec.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_e2c64b7dcfafaf4972521c5451fe0969_31bf3856ad364e35_6.2.9200.20731_none_e49db3e242b39446.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_eec6c535ad67563dd8b8f6ac043dfe2b_31bf3856ad364e35_6.2.9200.20731_none_531160cca4650930.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_f62187109141bad6db8b1238954791e1_31bf3856ad364e35_6.2.9200.16626_none_d4bb2854267c0cd5.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Amd64_f84e3899861bc6b7dd8c4a426046ab50_31bf3856ad364e35_6.2.9200.16626_none_34f7425e013d0e5a.manifest

File version

Not applicable

File size

687

Date (UTC)

30-May-2013

Time (UTC)

15:34

Platform

Not applicable

File name

Msil_system.management.automation_31bf3856ad364e35_6.2.9200.16626_none_996281338d2c68d2.manifest

File version

Not applicable

File size

1,718

Date (UTC)

30-May-2013

Time (UTC)

02:53

Platform

Not applicable

File name

Msil_system.management.automation_31bf3856ad364e35_6.2.9200.20731_none_82964ca5a6d2620a.manifest

File version

Not applicable

File size

1,718

Date (UTC)

30-May-2013

Time (UTC)

08:09

Platform

Not applicable

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.