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.

Please feel free to provide feedback or file bugs here.

(thinking…)

Enter your idea and we'll search to see if someone has already suggested it.

If a similar idea already exists, you can support and comment on it.

If it doesn't exist, you can post your idea so others can support it.

Enter your idea and we'll search to see if someone has already suggested it.

  • Hot ideas
  • Top ideas
  • New ideas
  • My feedback
  1. Fix .NET date formatting bug in .ToString()

    PS D:\> gcim win32_operatingsystem | % caption
    Microsoft Windows Server 2016 Standard

    PS D:\> $PSVersionTable.PSVersion

    Major Minor Build Revision
    ----- ----- ----- --------
    5 1 14393 1358

    PS D:\> [DateTime]::Now.ToString('yyyy-MM-dd HH:mm:ss')
    2017-07-27 12.29.37

    8 votes
    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)

      We’ll send you updates on this idea

      9 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
    • [BUG] Cannot import both PSDesiredStateConfiguration in-box module and PSDscResources (gallery module) in the same configuration

      OS: Windows Server 2016 1607 (14393.1593)
      PSVersionTable:
      Name Value
      ---- -----
      PSVersion 5.1.14393.1532
      PSEdition Desktop
      PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
      BuildVersion 10.0.14393.1532
      CLRVersion 4.0.30319.42000
      WSManStackVersion 3.0
      PSRemotingProtocolVersion 2.3
      SerializationVersion 1.1.0.1

      PSDscResource module: v2.8.0.0

      Take a look at this configuration:
      Configuration DependentConfig
      {
      Import-DscResource -ModuleName PSDscResources -Name Registry

      Node MyNode01
      {

      File SetupScript
      {
      DestinationPath = 'C:\Scripts\hello.txt'
      Contents = 'somecommand'
      Type = 'File'
      Ensure = 'Present'
      DependsOn = '[Registry]regCheck'
      }

      Registry regCheck
      {
      Key = 'HKEY_LOCAL_MACHINE\SYSTEM\SomeKey'
      ValueName = 'SomeValue'
      ValueData = 0
      ValueType = 'DWord'
      Ensure = 'Present'
      }
      }
      }

      DependentConfig -OutputPath C:\DependentConfig

      This requires PSDscResources module version 2.8.0.0 from…

      2 votes
      Sign in
      Check!
      (thinking…)
      Reset
      or sign in with
      • facebook
      • google
        Password icon
        I agree to the terms of service
        Signed in as (Sign out)

        We’ll send you updates on this idea

        3 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
      • We need a proper set of built-in, easy-to-use, dedicated registry cmdlets

        Managing registry keys and values on local and remote systems with PowerShell is a pain.

        Reviewing the articles, forums and blogs on the Internet clearly shows that new PowerShell users struggle to understand how to use registry provider drives and the cmdlets like New-Item, Get-ItemProperty, New-ItemProperty, and so on. This has prompted the creation of a variety of home-brew modules and functions to deal with the problem, like this one, which is extremely useful, but is not built into PowerShell by default of course:

        https://gallery.technet.microsoft.com/RegistryLibrarypsm1-b38a81ba

        PowerShell needs a proper set of built-in, dedicated registry cmdlets that 1) are easy to…

        20 votes
        Sign in
        Check!
        (thinking…)
        Reset
        or sign in with
        • facebook
        • google
          Password icon
          I agree to the terms of service
          Signed in as (Sign out)

          We’ll send you updates on this idea

          3 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
        • update-help : Failed to update Help for the module(s) 'Provisioning'

          I receive the following error when running Update-Help in PowerShell.

          PS C:\WINDOWS\System32\WindowsPowerShell\v1.0\Modules\Provisioning> update-help
          update-help : Failed to update Help for the module(s) 'Provisioning' with UI culture(s) {en-US} : Unable to retrieve
          the HelpInfo XML file for UI culture en-US. Make sure the HelpInfoUri property in the module manifest is valid or
          check your network connection and then try the command again.
          At line:1 char:1
          + update-help -force
          + ~~~~~~~~~~~~~~~~~~
          + CategoryInfo : ResourceUnavailable: (:) [Update-Help], Exception
          + FullyQualifiedErrorId : UnableToRetrieveHelpInfoXml,Microsoft.PowerShell.Commands.UpdateHelpCommand

          PowerShell info:
          PS C:\> $PSVersionTable.PSVersion

          Major Minor Build Revision
          ----- ----- ----- --------
          5 1 15063 138

          23 votes
          Sign in
          Check!
          (thinking…)
          Reset
          or sign in with
          • facebook
          • google
            Password icon
            I agree to the terms of service
            Signed in as (Sign out)

            We’ll send you updates on this idea

            7 comments  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
          • Get-Credential does not support Smart Card user name hints

            If you utilize Smart Cards with certificates that are not directly linked to users (no suitable user DN in Subject and no UPNs in SANs), you are able to link a single certificate to multiple accounts dynamically with the caveat that users need to provide explicit user name hints during logon in order to log on.

            User name hints need to be enabled via GPO or registry settings ("X509HintsNeeded"), after which all standard credential dialogs in Windows support them, except PowerShell's Get-Credential. This effectively prevents using PowerShell remoting with such Smart Cards / certificates if different credentials are required.

            In…

            6 votes
            Sign in
            Check!
            (thinking…)
            Reset
            or sign in with
            • facebook
            • google
              Password icon
              I agree to the terms of service
              Signed in as (Sign out)

              We’ll send you updates on this idea

              0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
            • Powershell does not interpret set variables

              Powershell has (optionally) replaced cmd as a standard shell in Windows 10.

              However it is a pity that Powershell is not able to interpret commands that rely on usage of variables that are defined in "set"

              like %computername%, %windir%, %userprofile%, %appdata% etc
              etc

              Please respect your own system variables in use for decades Microsoft. Thank you a lot.
              There must be way without breaking this.

              try issuing a simple

              cd %appdata%

              in powershell (often used in KB articles), good luck and have fun (or not).

              Imho while I could understand limitations this is pretty odd.

              2 votes
              Sign in
              Check!
              (thinking…)
              Reset
              or sign in with
              • facebook
              • google
                Password icon
                I agree to the terms of service
                Signed in as (Sign out)

                We’ll send you updates on this idea

                3 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
              • Can you add some stuff to Get-ClipBoard?

                I would have liked the default behaviour to be that an array of newline-split strings was returned from Get-ClipBoard. 97 % of the time I end up writing (Get-ClipBoard) -split "\r?\n" | ...... often filtering out empty elements - and that's just boring.

                In my own version I used -Raw for a string and nothing for an array/list.

                Of course you can't change that now in the 5.x version (or later, sigh, will this be our doom in some distant future), but can you maybe add at least -AsArray or similar? Make it so it can only be used with…

                3 votes
                Sign in
                Check!
                (thinking…)
                Reset
                or sign in with
                • facebook
                • google
                  Password icon
                  I agree to the terms of service
                  Signed in as (Sign out)

                  We’ll send you updates on this idea

                  0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                • Command line parsing bug: spaces and trailing slash

                  There appears to be a bug parsing arguments to EXEs. If you pass a properly-quoted path that has spaces and a trailing slash, the rest of the command is lumped into the same argument. This also happens if you use a PowerShell variable to hold the path string.

                  To repro, first, install EchoArgs.exe (if using chocolatey: cinst -y echoargs). It demonstrates what arguments would get passed to any exe.

                  Then run:

                  PS> & EchoArgs "C:\spaces and trailing slash\" more args

                  Echo args shows that it all got lumped into one argument:

                  Arg 0 is <C:\spaces and trailing slash" more args>

                  4 votes
                  Sign in
                  Check!
                  (thinking…)
                  Reset
                  or sign in with
                  • facebook
                  • google
                    Password icon
                    I agree to the terms of service
                    Signed in as (Sign out)

                    We’ll send you updates on this idea

                    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                  • Out-GridView should not leave a trailing tab character when ctrl+c is used with only one data row present.

                    I wrote a script that takes a MAC address in any common format as input and outputs it to all other standard MAC formats. This is all in a single row of data and is meant to be a convenient tool for working between systems that use different formats of MACs without having to constantly reformat them by hand. However, when copying the output from the gridview a trailing tab is placed at the end of the MAC even though there is only a single row in the view and no tabs in the original text. It's like it is…

                    1 vote
                    Sign in
                    Check!
                    (thinking…)
                    Reset
                    or sign in with
                    • facebook
                    • google
                      Password icon
                      I agree to the terms of service
                      Signed in as (Sign out)

                      We’ll send you updates on this idea

                      2 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
                    • Bug in New-FileCatalog

                      This bug also applies to Test-FileCatalog, I believe.

                      Create a script containing the following commands, and run it with the -Verbose switch

                      ----------------------------------------------------------

                      [CmdletBinding()]

                      param ( $path = 'SOMEPATHOROTHER'

                      New-FileCatalog -Path $path -CatalogFilePath C:\Source.cat -CatalogVersion 2.0
                      New-FileCatalog -Path $path -CatalogFilePath C:\Destination.cat -CatalogVersion 2.0

                      ----------------------------------------------------------

                      The output will contain VERBOSE output, even though the script does not contain any Write-Verbose commands.

                      1 vote
                      Sign in
                      Check!
                      (thinking…)
                      Reset
                      or sign in with
                      • facebook
                      • google
                        Password icon
                        I agree to the terms of service
                        Signed in as (Sign out)

                        We’ll send you updates on this idea

                        1 comment  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
                      • Pure Pain: Preinstalled PS Modules - Please Rationalize Them with Package Management Installs

                        I am trying to update Pester on Windows 2016 to 4.x because the preshipped Pester 3.4.0 emits a note about the depreciation of the -quiet switch when I use the quiet switch. This get's scooped into stdout when executing via AWS SSM remote commands. Version 3.x complains it does not understand "-Show None".

                        I want to update to 4.x - in which I ran into all the problems documented here: https://github.com/OneGet/oneget/issues/215

                        But ended up with "Install-module pester -force -SkipPublisherCheck.

                        So far so bad, but when I go to remove the 3.4.0 version (with admin rights) from: 'c:\program files\windowspowershell\modules\pester\3.4.0' I get…

                        1 vote
                        Sign in
                        Check!
                        (thinking…)
                        Reset
                        or sign in with
                        • facebook
                        • google
                          Password icon
                          I agree to the terms of service
                          Signed in as (Sign out)

                          We’ll send you updates on this idea

                          1 comment  ·  Package Management  ·  Flag idea as inappropriate…  ·  Admin →

                          The issues you have encountered can be frustrating, sorry that is the case for you.

                          Moving this to Survey to try to gauge the scope of the problem for users generally.

                          We are somewhat limited by security requirements: what ships with Windows will always be tagged so that nothing can replace it easily unless it is signed by Microsoft. While Pester is part of Windows, it is not owned or developed by Microsoft, so updates delivered via the Gallery cannot be Microsoft signed.

                          Once the Gallery version is installed on a system, -SkipPublisherCheck is no longer required for future updates. That first experience, however, is bad.

                          This leaves us with a dilemma: do we stop shipping Pester in with PowerShell in the future, or do we continue to provide the feature set knowing users who update from the Gallery will encounter these issues?

                          Looking for feedback from as many users…

                        • Catch illegal syntax in array definition

                          Today I had an issue where getting an element at a certain index in a typed array failed. As I was troubleshooting this issue I found that it was simply because I had used a '.' (dot) instead of a ',' (comma) to separate the elements when I defined the typed array variable.
                          Okay, that is a clear mistake on my part. However, as I thought about it I would have loved to be alerted by the Powershell engine .

                          -- Experienced on v5.1.14409.1012 of PowerShell
                          -- Win7 x64 OS

                          TO REPRODUCE:

                          open vscode
                          create ps1 file
                          $array = "hej",…

                          1 vote
                          Sign in
                          Check!
                          (thinking…)
                          Reset
                          or sign in with
                          • facebook
                          • google
                            Password icon
                            I agree to the terms of service
                            Signed in as (Sign out)

                            We’ll send you updates on this idea

                            0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                          • [BUG] Drag and drop to scripts shortcuts split paths containing spaces

                            Drag and dropping any file to a script shortcut split this path before passing the splitted strings as multiple parameters. Here's my detailed Issue Report :

                            Steps to reproduce
                            ------------------

                            1 - Get any script, for example :
                            [samplescript.psd1] :
                            ```
                            param([string]$path)
                            Write-Host($path)
                            pause
                            ```
                            or a simpler one-line sample: ```Write-Host($args);pause```

                            2 - Create a shortcut that runs the script :
                            [Shortcut Target ] : ```PowerShell "path\to\our\samplescript.psd1"```

                            3- Drag and drop a file containing spaces in its name to the shortcut
                            [sample file ] : ```C:\Some file with spaces.txt```

                            Expected behavior
                            -----------------

                            Drag and dropping the file should pass its…

                            1 vote
                            Sign in
                            Check!
                            (thinking…)
                            Reset
                            or sign in with
                            • facebook
                            • google
                              Password icon
                              I agree to the terms of service
                              Signed in as (Sign out)

                              We’ll send you updates on this idea

                              0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                            • PowerShell Classes should allow properties with get and set

                              PowerShell classes should more closely mirror the abilities of a C# class imported and allow full differentiation between fields and properties. Properties should allow getter and setter code blocks

                              1 vote
                              Sign in
                              Check!
                              (thinking…)
                              Reset
                              or sign in with
                              • facebook
                              • google
                                Password icon
                                I agree to the terms of service
                                Signed in as (Sign out)

                                We’ll send you updates on this idea

                                0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
                              • BUG: GetMetaConfiguration should validate property values against allowed values of MSFT_DSCMetaConfiguration CIM Properties

                                Once a node meta configuration is enacted, it is easy for an administrator or process (with malicious intent) to modify the MetaConfig.mof file in C:\Windows\System32\Configuration directory. The GetMetaConfiguration method in MSFT_DscMetaConfiguration class does not validate the property values against the allowed values of the CIM properties.

                                Steps to reproduce this behavior:
                                - Enact a simple meta configuration and enact it.
                                - Open the MetaConfig.MOF file in your favorite editor and change the value of ConfigurationMode to some random text.
                                - Save the file and close it.
                                - Run Get-DscLocalConfigurationManager.
                                - You will see the random value assigned to ConfigurationMode in…

                                1 vote
                                Sign in
                                Check!
                                (thinking…)
                                Reset
                                or sign in with
                                • facebook
                                • google
                                  Password icon
                                  I agree to the terms of service
                                  Signed in as (Sign out)

                                  We’ll send you updates on this idea

                                  1 comment  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →

                                  Ravikanth,

                                  We have validated this issue and created two bugs for it.

                                  1. We will validate the MOF when it is passed in as part of our API (i.e. Set-DscLocalConfigurationManager) and error if the values are not valid.
                                  2. We will write a warning when Get-DscLocalConfigurationManager reads a MOF that has invalid values and at LCM startup. The resultant behavior will behave like it does today where invalid values will be read as the default value by the LCM.

                                  Please let us know if this meets your expectations.

                                  Regards,

                                  MarkG

                                • Make the Continue statement work in ForEach-Object

                                  Within in ForEach-Object script block, "continue" behaves like "break", and one should use "return" to simulate "continue". But, from my perspective, it would make sense to give "continue" foreach-object awareness

                                  3 votes
                                  Sign in
                                  Check!
                                  (thinking…)
                                  Reset
                                  or sign in with
                                  • facebook
                                  • google
                                    Password icon
                                    I agree to the terms of service
                                    Signed in as (Sign out)

                                    We’ll send you updates on this idea

                                    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                                  • Double DependsOn in mof when using foreach loops

                                    When using a foreach loop to create a set of resources and trying to set the previous item key as the dependsOn resource, it adds it twice in the mof file.

                                    Configuration example:
                                    configuration Test-DependsOnWithLoop {
                                    param([string[]]$Directories)
                                    Import-DscResource -ModuleName PSDesiredStateConfiguration
                                    node localhost {
                                    $dependsOn = $null
                                    $dirs.ForEach({
                                    $res = $_ -replace '\\|:', '_'
                                    File $res {
                                    Ensure = 'Present'
                                    DestinationPath = $_
                                    DependsOn = $dependsOn
                                    Type = 'Directory'
                                    }
                                    $dependsOn = "[File]$res"
                                    })
                                    }
                                    }

                                    $dirs = 1..10 | % { "C:\Temp\_$_" }
                                    Test-DependsOnWithLoop -Directories $dirs

                                    And if you look at the localhost.mof you'll see:
                                    DependsOn = { "[File]C__Temp__1", "[File]C__Temp__1"};

                                    1 vote
                                    Sign in
                                    Check!
                                    (thinking…)
                                    Reset
                                    or sign in with
                                    • facebook
                                    • google
                                      Password icon
                                      I agree to the terms of service
                                      Signed in as (Sign out)

                                      We’ll send you updates on this idea

                                      0 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
                                    • Bug: Integrated Modules are not loaded if you have a Network Path in $env:PSModulePath which is not reachable

                                      Integrated Modules are not loaded if you have a Network Path in $env:PSModulePath which is not reachable.

                                      ##############
                                      I have customized the PSModulePath:

                                      PS C:\Users\username> ($env:PSModulePath).split(';')
                                      C:\Users\username\Documents\WindowsPowerShell\Modules
                                      C:\Program Files\WindowsPowerShell\Modules
                                      C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
                                      c:\Program Files\Microsoft Security Client\MpProvider\
                                      C:\Program Files\Microsoft Monitoring Agent\Agent\PowerShell\
                                      \\my.domain\share\Modules\

                                      ##############
                                      If i try to execute e.g. Invoke-RestMethod

                                      PS C:\Users\username> Invoke-RestMethod
                                      Invoke-RestMethod : The 'Invoke-RestMethod' command was found in the module 'Microsoft.PowerShell.Utility', but the
                                      module could not be loaded. For more information, run 'Import-Module Microsoft.PowerShell.Utility'.
                                      At line:1 char:1
                                      + Invoke-RestMethod
                                      + ~~~~~~~~~~~~~~~~~
                                      + CategoryInfo : ObjectNotFound: (Invoke-RestMethod:String) [], CommandNotFoundException
                                      + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule


                                      PS C:\Users\username> Get-Command Invoke-RestMethod
                                      Get-Command : The term…

                                      3 votes
                                      Sign in
                                      Check!
                                      (thinking…)
                                      Reset
                                      or sign in with
                                      • facebook
                                      • google
                                        Password icon
                                        I agree to the terms of service
                                        Signed in as (Sign out)

                                        We’ll send you updates on this idea

                                        1 comment  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
                                      • Powershell ISE crashes when saving an ini file (I tried config.ini)

                                        I created a new file, saved as config.ini, and then ISE crashed. When I reopened, it crashed again.

                                        1 vote
                                        Sign in
                                        Check!
                                        (thinking…)
                                        Reset
                                        or sign in with
                                        • facebook
                                        • google
                                          Password icon
                                          I agree to the terms of service
                                          Signed in as (Sign out)

                                          We’ll send you updates on this idea

                                          0 comments  ·  ISE and tooling  ·  Flag idea as inappropriate…  ·  Admin →
                                        • powershell_ise has stopped working

                                          Problem Description:
                                          I installed KB3134760 update in Server 2008. The powershell_ise has stopped working. Does anyone have the same problem?
                                          Thanks

                                          1 vote
                                          Sign in
                                          Check!
                                          (thinking…)
                                          Reset
                                          or sign in with
                                          • facebook
                                          • google
                                            Password icon
                                            I agree to the terms of service
                                            Signed in as (Sign out)

                                            We’ll send you updates on this idea

                                            0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
                                          ← Previous 1 3 4 5 59 60
                                          • Don't see your idea?

                                          Feedback and Knowledge Base