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. Serious MASSIVE BUG: Mount-DiskImage not scriptable

    Hi

    Mounting a ISO image is happening via Mount-DiskImage -ImagePath C:\ISO\isofile.iso -PassThru. This is working.

    BUT: the -ImagePath parameter doesn´t accept any(!) variables. This makes it absolute and total unusable in a script because usually the Path to a iso isn´t always static.

    If I have an static Path i can use the explorer. Its faster and easier.
    Dissapointing

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

    We’ll send you updates on this idea

    3 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  2. "Using module" statement does not reload module after changes are made

    Problem Description
    ------------------
    If you are using the `using module` statement, it will load the module without any issues. However, if you make a change to the module and run the `using module` statement again without restarting your PowerShell session, it will not load the new modified module into memory, and instead will continue to use the old existing module that was loaded. This makes doing development with `using module` statements very tedious as you must continually reload your PowerShell session whenever you make changes to the module.

    Ideally we would just use `Import-Module -Name [module name] -Force` to avoid…

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

    We’ll send you updates on this idea

    3 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  3. Pressing spacebar while holding shift should still insert a space

    Pressing spacebar while holding shift should still insert a space.

    When I am typing into the PowerShell prompt, if I happen to be holding down the shift key when I hit the spacebar, nothing happens. I would like for a space to be inserted when I hit the spacebar, regardless of whether I am holding the shift key or not. (The classic Command Prompt does this correctly.)

    For reference, I'm using Win10 1809 and:

    PS C:\> $PSVersionTable

    Name Value
    ---- -----
    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
    WSManStackVersion 3.0
    PSRemotingProtocolVersion 2.3
    SerializationVersion 1.1.0.1

    3 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 →
  4. Allow use of curly braces for special cases

    Such as git stash apply stash@{2} instead of need for inside quotes "" "stash@{2}"

    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 →
  5. While passing a json stream to a out file PS fails while cmd succeeds. Ending '}' bracket is missing.

    # Steps to reproduce
    1. I use a tool called rabtap to publish messages to rabbitMQ. Tool can be found here: https://github.com/jandelgado/rabtap
    2. When I tap on an exchange and redirect output to a file.
    -> It comes OK when I use this cmd on cmd prompt (i.e., as here): rabtap tap "myexchange:" --json > c:\tmp\usingCMDline.txt"
    -> However if I redirect the output using powershell, I miss out the ending bracekt in the output file. rabtap tap "myexchange:" --json | Out-File "c:\tmp\ps02.txt" (see attached output)
    # Expected behavior
    Full JSON should output, as done by the cmd line redirect operator.

    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. RequiredModules statement in Module Manifests should allow for Verbose:$false to be included

    Currently module imports initiated via the RequiredModules statement in a Module Manifest do not allow for verbosity preference.

    This results in a lot of additional noise for end users.
    For example. If a DSC Resource module requires other modules, and imports them via RequiredModules in the Module Manifest then the following happens:

    If an end-user is attempting to troubleshoot their DSC configuration they will utilize

    Start-DscConfiguration -UseExisting -Verbose -Force

    The results will be a verbose line for every cmdlet imported/exported from every included module. Which is A LOT of noise surrounding the verbose messages actually relevant to the end user.

    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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  7. Change the default for $ErrorActionReport to "stop"

    I'm kind of new to PowerShell, but I've been scripting with Bash, Perl, Python, etc... for years. Today, when writing a quick try/catch in Powershell, the catch would never run. After much searching, I came to learn that the default action in PowerShell is to ignore a catch with $ErrorActionReport = "Continue" (the default value). Is there a reason that the default is like that? I would think the vast majority of scripts using try/catch would want to actually run the catch, so why is the default "Continue" and not "stop"?

    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 →
  8. Remote Invoke-Command with -ScriptBlock changes types of arguments if scripblock contains variables

    What's going on here???

    PS C:\> Invoke-Command -ComputerName somemachine -Credential $cred -ArgumentList {Write-Host hi} -ScriptBlock {param($sb); Write-Host $sb.GetType().Name}
    ScriptBlock
    PS C:\> Invoke-Command -ComputerName somemachine -Credential $cred -ArgumentList {Write-Host hi} -ScriptBlock {param($sb); Write-Host $sb.GetType().Name; $a=3}
    String
    PS C:\> Invoke-Command -ComputerName somemachine -Credential $cred -ArgumentList {Get-ChildItem} -ScriptBlock {param($sb); Write-Host $sb.GetType().Name}
    ScriptBlock
    PS C:\> Invoke-Command -ComputerName somemachine -Credential $cred -ArgumentList {Get-ChildItem} -ScriptBlock {param($sb); Write-Host $sb.GetType().Name; $a=3}
    String

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

    We’ll send you updates on this idea

    5 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  9. Bug: Get-Random doesn't return Maximum value.

    setting a maximum value for get-random doesn't return the maximum value.
    $I=@{1=0;2=0}
    for ($q=1;$q -le 10000;$q++) {
    $VAL=Get-Random -Minimum 1 -Maximum 2
    $I[$VAL]++
    }

    $I

    Name Value
    ---- -----
    2 0
    1 10000

    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 →
  10. Hhhmmmmm ...

    Sounds good to me!

    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 →
  11. FeatureRequest: Have New-PSdrive store credentials in Credential Manager when Persist and Credential options used

    Currently there is no built in or easy way to have credentials stored to map persistent Drives via a script.

    If you are mapping a drive for the same domain that the system is on then it will pass-through the current user's credentials, and it will save alternate credentials for the mapping in the current user session. However if you are trying to map a persistent drive for a share from a different non-federated domain, a workgroup computer, or for something on the same domain using different credentials, the password is not saved through logouts or reboots. Not only is…

    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 →
  12. Bug:New-PSDrive altering stored username in registry persistence entry when using credential object from different domain in UPN format

    # Steps to reproduce

    # Must use the format username@domain for username and be mapping share from different non-federated domain to reproduce
    $Cred = Get-Credential
    $Path = 'Path to the share'
    New-PSDrive -Name 'P' -PSProvider FileSystem -Root $Path -Persist -Credential $Cred -Scope Global

    # Expected behavior

    The $Cred.username value gets stored in the registry under HKEY_CURRENT_USER\Network\P
    in the UserName string value without alteration.

    # Actual behavior

    The domain of the system running the commands gets appended in the front of the username from the cred object when stored in the reg key.

    For example if $Cred.Username is 'username@Domain1.com'…

    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 →
  13. "The script failed due to call depth overflow" in non-recursive function

    I have a filter in a script module that a does a little error formatting and flags the fact that it's seen an error. Most of the time, it seems to do its little job just fine. About once a week a sharing violation triggers some kind of infinite recursion and PowerShell emits the depth overflow error. The odd thing is that the function is not recursive. I've run procmon and I can see that the sharing violation happens just once - most of what happens after than is PowerShell writing to a pstrace log (I've wrapped the offending section…

    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 →
  14. New-NetIPAddress Prefixlength not working

    New-NetIpaddress in windows 10 1903 ent will not accept 27 as a prefix length

    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 →
  15. get-childitem doesn't easily pipe full path to foreach_object

    This is already changed in PS 6. I think it would be very useful in PS 5.1. The string version of what get-childitem returns doesn't have the full path. I know $_.fullname would work, but it's more trouble. A lot of people ask about this.

    PS C:\users> get-childitem myuser\foo\ | foreach-object { get-content $_ }
    get-content : Cannot find path 'C:\users\hi.txt' because it does not exist.
    At line:1 char:47
    + get-childitem myuser\foo | foreach-object { get-content $_ }
    + ~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (C:\users\hi.txt:String) [Get-Content], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

    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 →
  16. Unable to paste a Chinese character 𠮷 to PowerShell or output the character from c#.

    I tried command Write-Host "𠮷"(Unicode code point 20BB7) in PowerShell but I am unable to paste the character to PowerShell.
    PowerShell output "?" when I paste the character .
    How can I resolve this issue ? Thank you.
    More details here
    https://social.msdn.microsoft.com/Forums/zh-CN/9accaed3-fcc5-4207-a6fe-5c464a9b7597/how-can-i-output-a-chinese-character-when-its-unicode-code-point-greater-than-65535-in-powershell?forum=win10itprogeneral

    2 votes
    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 →
  17. BUG: Shell crashing with x509Certificate2 objects

    Problem:

    When creating an object from the x509Certificate class the shell adds 3 script properties:

    DnsNameList
    EnhancedKeyUsageList
    SendAsTrustedIssuer

    The SendAsTrustedIssuer property causes Powershell to hit a CLR exception and hard crash when accessed.

    Repro Code:

    * Note: do this in a fresh session as it will crash the session

    $Test = New-Object System.Security.Cryptography.x509Certificates.x509Certificate2
    $Test | select *

    Alternately,

    $Test = New-Object System.Security.Cryptography.x509Certificates.x509Certificate2
    $Test.SendAsTrustedIssuer

    Crash dump:

    Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    at System.Management.Automation.Security.NativeMethods.CertGetCertificateContextProperty(IntPtr pCertContext, CertPropertyId dwPropId, IntPtr pvData, Int32& pcbData)
    at Microsoft.PowerShell.Commands.SendAsTrustedIssuerProperty.ReadSendAsTrustedIssuerProperty(X509Certificate2 cert)
    at CallSite.Target(Closure ,…

    4 votes
    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 →
  18. Invoke-Command does not respect -ErrorAction parameter

    Hey guys, this does not seem to be fixed. Is this by design? Invoke-Command does not respect -ErrorAction parameter which means it cannot be suppressed using SilentlyContinue nor can it be trapped using a Try..Catch block.

    This issue is present in both WinPS and PowerShell Core. Does not seem like intended behavior since the $Error[0] variable and $ResolutionError ErrorVariable are set by PowerShell outside of the scriptblock.

    Invoke-Command -ScriptBlock { Get-Content c:\file\does\not\exist.txt } -ErrorAction SilentlyContinue -ErrorVariable ResolutionError

    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. Ability to register a wrapper function to be called before a cmdlet is being executed

    Helpful for example to check if remote sessions are still healthy and re-open them in case they are broken.

    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 →
  20. Query path language to query nested hash tables

    Expected:
    Directly use query path language to query nested hash tables

    Current:
    1. Convert the hash table into json
    2. Load json by Newtonsoft.Json
    3. use Json query language to query

    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 →
← Previous 1 3 4 5 22 23
  • Don't see your idea?

Feedback and Knowledge Base