PowerShell

The PowerShell forum accepts bug reports as well as feedback and suggestions. For more information, check out the PowerShell Homepage

The following is a list of the states we use to track items.

status meaning
survey We saw this and we are considering it. Please upvote if it’s important to you.
needs more information We don’t understand the issue and need additional details.
investigating We are looking at this internally to understand things like: scenario, reproduction of issue, costing, or other technical details.
in queue The issue is understood and in our unprioritized backlog. Your votes will be used to drive prioritization of this work.
  • Hot ideas
  • Top ideas
  • New ideas
  • My feedback
  1. Allow expansion of columns in output

    For example, I type in Get-PrinterPort and press return. It shows me the output for all printers. However, I have one printer with a port (defined by Windows) as a really really long text string. The output in Powershell truncates it which renders the output utterly useless. I need a way to have output non-truncated

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  2. Warum gibt es keine Links zu den betroffenen Objekten in docs.microsoft.com z.B. get-clustergroup ->Objekt clustergroup?

    Warum gibt es keine Links zu den betroffenen Objekten in docs.microsoft.com z.B. get-clustergroup ->Objekt clustergroup?

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Documentation  ·  Flag idea as inappropriate…  ·  Admin →
  3. Missing newer computer account in Get-LocalUser on a DC

    in PowerShell 5.1.14393.2608 when I run Get-LocalUser * on a Windows Server 2016 Domain Controller I should get a list of all domain user and computer. But the newest Domain joined computer is missing.
    Please fix this.
    Also when I run Get-LocalUser MyComputer$ and MyComputer is the last domain joined computer I get ObjectNotFound

    2 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  4. you suck !!!!

    Register-ScheduledTask : The task XML is malformed.
    (1,2)::ERROR: incorrect document syntax

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Documentation  ·  Flag idea as inappropriate…  ·  Admin →
  5. powershell get-childitem works unexpected differently

    Hi there

    Im working with WindowsPE and have to identify my USB-Drive.

    So I´m looking for the drive and assign a variable:

    $usb_drive = (Get-WmiObject -class Win32_LogicalDisk -filter DriveType=2 | Foreach {Get-ChildItem -Filter *.wim -r -d 1 $_.DeviceID} 2>$null | Where {$_.name -eq "boot.wim"}).PsDrive.Root

    With Powershell 5.1.14393.2791 its working as expected. With 5.1.18361.1 not.

    The reason is this part:

    Get-WmiObject -class Win32_LogicalDisk -filter DriveType=2 | Foreach {Get-ChildItem -Filter *.wim -r -d 1 $_.DeviceID}

    The Reason is handling of $_.Deviceid. On both versions the Result is c:

    On both versions Get-Childitem C: gets the entries of the local directory (which makes…

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  6. 'Using module' does not work when having multiple levels of inheritance

    When having more than one level of inheritance, 'Using module' does not work as expected.

    Example:

    Class A is defined in module A.
    Class B is defined in module B.
    Class C is defined in module C.

    A.psm1
    class A {}

    B.psm1
    Using module 'A'

    class B : A {}

    C.psm1
    Using module 'B'

    class C : B {}

    With the above example class C only inherits the properties and methods from B class and not from A class.

    The reason for separating the classes in different modules is to allow their reuse in other modules.

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  7. Bug: Ps1 script file with extra extension gets deleted when called from CMD

    When calling PowerShell from CMD and specifying a script file that contains an extra "extension" (extra dot) in the base name, the script is not run but the file is mysteriously deleted:

    Example (run in CMD):

    powershell -file c:\temp\script.txt.ps1

    The same issue when called like this:

    powershell -command "& c:\temp\script.txt.ps1"

    This has been reproduced by me and others on different machines with different paths.

    The same issue exists when called from inside PowerShell like this:

    . "powershell.exe" -file c:\temp\script.txt.ps1
    Start-Process "powershell" -Arg "-file, "c:\temp\script.txt.ps1"

    Note that these will work just fine:

    powershell -command "& 'c:\temp\script.txt.ps1'"
    powershell -command ";& c:\temp\script.txt.ps1"
    powershell…

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
  8. Write-Information does not show in a file transcribed by Start-Transcript

    Write-Information does not show in a file transcribed by Start-Transcript unless you set $InformationPreference to 'SilentlyContinue'... which then means it does not display in the console.

    I believe this is a bug in Windows PowerShell (as of v5.1.17134.590) that has been fixed in PowerShell Core? If we cannot go to Core I have to do some workarounds (like using Write-Host or creating a function that combines 2 Write-Information calls with different preferences).

    There looks like a better formatted thread here on this issue:
    https://stackoverflow.com/questions/55191548/write-information-does-not-show-in-a-file-transcribed-by-start-transcript

    Here's $PSVersionTable:
    ---------------------------------------------------------------------------
    PSVersion 5.1.17763.316
    PSEdition Desktop
    PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
    BuildVersion 10.0.17763.316
    CLRVersion 4.0.30319.42000 …

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  9. Mount-DiskImage fails with: "Access is denied" 0x5 occurred while reading the console output buffer

    After upgrade from Windows 1803 to Windows 1809 `Mount-DiskImage $iso_path` starts failing with the following error:

    ```
    Exception calling "EndProcessing" with "0" argument(s): "Win32 internal error "Access is denied" 0x5 occurred while reading the console output buffer. Contact Microsoft Customer Support Services."
    At line:352 char:17
    + $__cmdletization_objectModelWrapper.EndProcessing()
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : HostException

    ```

    The powershell command is executed under Administrator user in packer. It actually mounts specified image path, but throws this exception on attempt to interact with stdout.

    2 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  10. SeServiceLogonRight is not getting cleaned up after exiting JEA session

    I have an issue with Just Enough Administration and Windows 2012 R2, where when I have the 'Run As Virtual account' set to true, it does not clean up after itself. The temporary virtual account is left in 'Logon as a service'. this can be viewed from the local security policy.

    https://github.com/PowerShell/PowerShell/issues/5296

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  WinRM  ·  Flag idea as inappropriate…  ·  Admin →
  11. The lock-bitlocker command help is wrong

    The cmdlet documentation for "Lock-Bitlocker" is wrong. First, the example contains the command Lock-Volume, that doesn't exists, and when issuing such command it doesn't recognize the mount point argument, stating it doesn't exists. This seem just an alias for manage-bde -lock "mountpoint" -forcedismount - that one works and should be cited in the documentation.

    https://docs.microsoft.com/en-us/powershell/module/bitlocker/lock-bitlocker?view=win10-ps

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Documentation  ·  Flag idea as inappropriate…  ·  Admin →
  12. Powershell Ghost Error Messages

    How can I get to discuss my issue with a human being regarding Powershell creating Ghost Error messages similar to what I started out but still is bug of some kind. During my testing, my script coding was modified to work properly. How may I rid myself from these Ghost Error messages? How can i connect up with a Microsoft Powershell Individual with the correct expertise?

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
  13. DISM Repair-WindowsImage should allow HTTPS URIs for image sources.

    Allow the DISM Repair-WindowsImage command to use HTTPS URIs for image sources. We use a common image to repair the insanely frequent container store corruption issues on our systems. It occurred to me that if somebody with malicious intent was able to alter the WIM files we use to facilitate this process it would lead to easy mass pwnage. Therefore, it makes sense to use an extremely simple, easy-to-lock-down protocol like HTTPS to provide access to these rather huge files rather than a complex protocol like SMB that forces us to expose many other RPC services as well. Yes, this…

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  14. [BUG] Start-Process might not return Handle/ExitCode

    Issue:
    In order to obtain the Exit Code from a Process we are executing the Start-Process cmdlet with the following parameters:
    -PassThru -Wait -WindowStyle Hidden
    or
    -PassThru -Wait -NoNewWindow

    In rare cases, this leads to the following exception:
    System.Management.Automation.CmdletInvocationException: Cannot process request because the process (<ProcessIdHere>) has exited. ---> System.InvalidOperationException: Cannot process request because the process (<ProcessIdHere>) has exited.
    at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited)
    at System.Diagnostics.Process.OpenProcessHandle(Int32 access)
    at System.Diagnostics.Process.get_Handle()

    After the Exception occurred, the returned Object does not contain a Handle nor Exit Code but the executable itself executed without issue.

    We also tried to remove the “-Wait” Parameter and…

    5 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  15. Extraneous results returned with Resolve-DnsName (dnsclient)

    Quoted feedback from documentation feedback provided by MSFT team below. (via @jordanmills)

    > When resolving SRV records (example: Resolve-DnsName -Name "_kerberos._tcp.dc._msdcs.$env:userdnsdomain" -Type SRV), the cmdlets also attempts to resolve any returned A or AAAA records and sends them to the pipeline as a separate object collection. This breaks pretty much any attempt to sort, group, filter, or otherwise process the data. How can we make it not return A and AAAA records for SRV queries?

    https://github.com/MicrosoftDocs/windows-powershell-docs/issues/302

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  16. Saving file in the remote session has failed with error: Exception has been thrown by the target of an invocation..

    Since a few weeks, when I edit a file in a PSSession in ISE I get this error message when I save the modifications:

    Saving file: C:\path\file.ps1 in the remote session has failed with error: Exception has been thrown by the target of an invocation..

    Not sure there is a link, but this problem appeared around the moment when this post has been published.

    https://devblogs.microsoft.com/powershell/windows-security-change-affecting-powershell/

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  ISE and tooling  ·  Flag idea as inappropriate…  ·  Admin →
  17. 1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Documentation  ·  Flag idea as inappropriate…  ·  Admin →
  18. "using module" does not take variable as parameter

    The "using module" statement does not take a variable as a parameter for the module name, which is inconvenient if you're writing scripts based on taking modules from variable DFS paths based on the environment (usign different Active Directory forests as the root for the paths for instance).

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  19. high CPU

    Found out when my CPU is high (99%-100) (i do set executionpolicy to remotesign/unrestricted also)
    When i run the PS script, it will ask for executionpolicy.
    but when i low CPU, it will just run the script.

    suspect value (executionpolicy remotesign) unable to pass thru to script.ps1 on time. so it prompt out everytime when CPU is high.
    do we have some setting to tune this. delay it, so that executionpolicy have more time to pass the value to script.ps1.

    ---------------------------------
    Script:
    $sourcefolder="D:\A743"
    $datenow = get-date
    $processdate = (get-date).Adddays(-3)

    get-childitem $sourcefolder -file | where-object { $_.lastwritetime -le $processdate } |…

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
  20. "Open Powershell window here" broken if file path contains an exclamation point

    If I Shift+RightClick and select "Open PowerShell window here" in a folder that starts with an exclamation point, PowerShell will open, but it won't open at the desired path.

    Example: C:\Users\admin\Documents\!testfolder\

    1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
  • Don't see your idea?

Feedback and Knowledge Base