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. The $foreach iterator does not behave properly when processing tokens

    This is a bug in PowerShell 2.0 and later versions (i.e. not a regression).

    The $foreach iterator does not advance inside of a foreach loop when processing tokens that come from the PowerShell parser. For example:

    $Filter = 'foo -eq $false'
    foreach ($token in [System.Management.Automation.PSParser]::Tokenize($Filter,([REF]$null))) {

    if ($token.Type -ne [System.Management.Automation.PSTokenType]::Command) {
    
    continue
    }
    $foreach.MoveNext() > $null
    $foreach.Current

    }

    If you run this, $foreach.Current is $null in the first iteration of the loop (this is wrong), and when you advance the iterator using MoveNext(), it then gets assigned to the first item in the collection.

    The workaround is to force the…

    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 →
  2. Scripts need better isolation from the user's global session state

    Votes from Connect: 4

    Original Date Submitted: 11/28/2015 5:59:49 AM

    Description:
    Contact Information
    Handle: Keith Hill MVP
    Site Name: PowerShell
    Feedback ID: 2065573


    Problem Description:
    Right now it is too hard to write a 100% reliable script that can run in any particular user's PowerShell console. The crux of the problem is that global session state is so varied amongst individual users it is hard to anticipate all possibilities such as:

    •Command proxies
    •Imported (auto or explicit) modules that implement the same named command (but semantically different)
    •Redirected aliases
    •Defined variables you weren't expecting to be defined
    •Removed globals you…

    3 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 →
  3. Add a new $PSModule standard variable

    Votes from Connect: 11

    Original Date Submitted: 11/16/2015 11:31:50 PM

    Description:
    Contact Information
    Handle: Stephen Owen
    Site Name: PowerShell
    Feedback ID: 2024074


    Problem Description:
    I find it very tiresome to have to specify $env:ProgramFiles\WindowsPowerShell\Modules in all of my modules. What a pain in the butt!

    Why not add a new standard variable called $PSModulePath or something similar, to make this automatic?

    Product Studio item created by Connect Synchronizer due to creation of feedback ID 2024074 (http://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=2024074).

    Repro Steps:

    Internal BugId: 15978

    3 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 →
  4. New #requires parameters: -DotSource/-CallOperator, to allow script authors to indicate how the script must be invoked

    Votes from Connect: 8

    Original Date Submitted: 11/5/2015 5:13:13 AM

    Description:
    Contact Information
    Handle: Kirk Munro
    Site Name: PowerShell
    Feedback ID: 1981963


    Problem Description:
    Scripts are designed to be either dot-sourced, called, or much less often, both. Yet the vast majority of scripts out there don't have anything in place to make sure that they were invoked the right way. This can lead to a lot of confusion for script consumers that could be easily avoided.

    I would like to see the #requires statement expanded with the addition of two new parameters: -DotSource and -CallOperator. When a script is invoked,…

    3 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 →
  5. Powershell 5 enum definitions

    Votes from Connect: 3

    Original Date Submitted: 8/11/2015 6:16:25 PM

    Description:
    Contact Information
    Handle: SamiKoskivaara
    Site Name: PowerShell
    Feedback ID: 1654123


    Frequency: PowerShell
    Regression: Create two enums, explicitly define a variable to have named enum type, assign value to that variable from another enum type. It does not give an error message that the value is not from the right enum type.

    Problem Description:
    If I define two enums 'Size' and 'PizzaType'

    Enum Size {

    Small
    
    Medium
    Large

    }

    Enum PizzaType {

    Margherita
    
    Vegetariana
    Peperoni

    }

    and then I want to explicitly say that my variable $a is [PizzaType] it…

    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 →
  6. Invoke-WebRequest doesn't work with protocol-relative URLs

    Votes from Connect: 4

    Original Date Submitted: 7/8/2015 11:36:23 AM

    Description:
    Contact Information
    Handle: Trevor Sullivan [MVP]
    Site Name: PowerShell
    Feedback ID: 1519608


    Frequency: PowerShell
    Regression: 1. Use the Invoke-WebRequest command to call a protocol-relative URL
    2. Exception occurs: "iwr : Invalid URI: The hostname could not be parsed."

    Problem Description:
    Invoke-WebRequest doesn't work with protocol-relative URLs.

    http://www.paulirish.com/2010/the-protocol-relative-url/

    Product Studio item created by Connect Synchronizer due to creation of feedback ID 1519608 (http://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=1519608).

    Repro Steps:
    1. Use the Invoke-WebRequest command to call a protocol-relative URL
    2. Exception occurs: "iwr : Invalid URI: The hostname could not be parsed."

    3 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. WMF5 April PowerShellGet Publish-Module NuGetAPIKey is Mandatory

    Votes from Connect: 3

    Original Date Submitted: 6/9/2015 1:49:33 AM

    Description:
    Contact Information
    Handle: Joel 'Jaykul' Bennett
    Site Name: PowerShell
    Feedback ID: 1413156


    Frequency: PowerShell
    Regression: Register-PSRepository -Name LocalFolder -Source "$Pwd" -Publish "$Pwd"
    Publish-Module -Name C:\Users\Joel\Projects\Modules\Autoload -Repository LocalFolder -NuGetApiKey (Get-Random)

    Problem Description:
    The NuGetApiKey should not be mandatory on Publish Module, because it's not actually mandatory.

    For instance, if I'm publishing to a local folder, I don't need to specify a key!

    Product Studio item created by Connect Synchronizer due to creation of feedback ID 1413156 (http://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=1413156).

    Repro Steps:
    Register-PSRepository -Name LocalFolder -Source "$Pwd" -Publish "$Pwd"
    Publish-Module -Name…

    3 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 →
  8. Wildcard in registry path causing high cpu / long enumeration

    Votes from Connect: 3

    Original Date Submitted: 5/23/2015 6:40:05 AM

    Description:
    Contact Information
    Handle: jskiba
    Site Name: PowerShell
    Feedback ID: 1357781


    Frequency: PowerShell
    Regression: within powershell console

    navigate to "HKLM:\SOFTWARE\Classes*"
    run "gci" to find an available subkey name (eg: "OpenWithList")
    run "get-acl .\OpenWithList
    Verify CPU load time, and registry enumeration via procmon

    Problem Description:
    The asterisk “” character is valid as a registry key name. When navigating to the path “HKLM:\SOFTWARE\Classes*” and attempting to query ACL for values such as those in “HKLM:\SOFTWARE\Classes*\OpenWithList” , everything under “Classes” is queried, treating the “” as a wildcard and not a…

    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 →
  9. Incorrect default values when pass $null as splatting parameter

    Votes from Connect: 5

    Original Date Submitted: 8/29/2014 4:44:23 PM

    Description:
    Contact Information
    Handle: EricDong1989
    Site Name: PowerShell
    Feedback ID: 958702


    Frequency: Always Happens
    Regression: Yes, this happens in all previous versions

    Problem Description:
    function test{

    param(        
    
    [Parameter(Mandatory=$false)][int]$age=20,
    [Parameter(Mandatory=$false)][string]$name = 'Name'
    )
    Write-Host $age
    Write-Host $name

    }
    $aa = $null
    test $aa

    You will see outputs:
    0
    Name

    However the age should be 20.
    Further more, modify the function above to
    function test{

    param(        
    
    

    [Parameter(Mandatory=$true)][int]$age,
    [Parameter(Mandatory=$false)][string]$name = 'Name'
    )
    Write-Host $age
    Write-Host $name

    }

    and run
    $aa = $null
    test $aa

    The result is same as above, but the $age…

    3 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 →
  10. Tab completing paths containing variables or environment variables should not replace those variables

    Votes from Connect: 19

    Original Date Submitted: 7/16/2013 9:20:31 PM

    Description:
    Contact Information
    Handle: Kirk Munro
    Site Name: PowerShell
    Feedback ID: 794116


    Frequency: Always Happens
    Regression: Yes, this happens in all previous versions

    Problem Description:
    If you reference a variable or an environment variable in a path and press tab, tab completion expands (replaces) the variable/environment variable with the actual value of that variable. In a scripting environment, this is anti-best scripting practices. Instead it should allow for tab completion while leaving the variable as a variable. Here are a few examples:

    Type:
    $PSHome\

    Then press <TAB>. $PSHome is replaced…

    3 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 →
  11. PS3CTP1: Invoke-RestMethod fails to return the entire output

    Votes from Connect: 20

    Original Date Submitted: 9/30/2011 1:14:25 AM

    Description:

    Contact Information
    Handle: Joel -Jaykul- Bennett
    Site Name: PowerShell
    Feedback ID: 691723


    Frequency: Always Happens
    Regression: No, this is new to the most recent version

    Problem Description:
    When using Invoke-RestMethod on an OData feed, it does not return collection-level data (it returns only the entry objects).

    This means that we don't get the feed title, id, or last "updated" time, but it also means we miss out on the two new pieces of collection-level metadata that were added in OData v2: the entry count, and the "next links" (aka…

    3 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 →
  12. ForEach collection method does not honor strict mode

    $a=$null,@{a=0}
    $sb={"Object from pipeline is$(if($null-ne$_){' not'}) null."}
    Set-StrictMode -Off
    $a|% b|% $sb
    $a.ForEach('b')|% $sb
    Set-StrictMode -Version Latest
    $a|% b|% $sb
    $a.ForEach('b')|% $sb

    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. BUG: No coercion operator is defined between types 'System.String' and 'System.Char'

    After upgrading WMF to 5.0 RTM on windows 7 64 bit, with office 2013 32 bit.

    I get the following in my mail signature script:
    No coercion operator is defined between types 'System.String' and 'System.Char'.

    the powershell line:
    $objSelection.TypeText([char]13)

    this worked fine before: workaround is to use this instead:
    $objSelection.TypeText(([char]13).tostring())

    psversiontable:
    Name Value


    PSVersion 5.0.10586.51
    PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
    BuildVersion 10.0.10586.51
    CLRVersion 4.0.30319.42000
    WSManStackVersion 3.0
    PSRemotingProtocolVersion 2.3
    SerializationVersion 1.1.0.1

    .Net is version 4.6.01055 (4.6.1)

    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 →
  14. BUG : WMI does not return correct value from a remote session

    BUG : WMI does not return correct value from a remote session

    Querying SCCM from WMI works localy but not from within a remote session.

    when running this locally on the sccm server it works as expected :

    get-wmiobject -NameSpace "ROOT\SMS\siteCT1" -class SMSImagePackage

    but nothing is returned from a pssession
    etsn SCCM-SERVER
    [SCCM-SERVER]PS> get-wmiobject -NameSpace "ROOT\SMS\siteCT1" -class SMSImagePackage

    does not work also with invoke-command
    icm SCCM-SERVER -scriptblock{ get-wmiobject -NameSpace "ROOT\SMS\siteCT1" -class SMSImagePackage }

    From remote session I can list the class but can't find any method or property :

    icm sccm-server -scriptblock {get-wmiobject -NameSpace…

    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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  15. Load XAML-GUI in Powershell with Show-XAMLDialog

    Load GUI in Powershell with Show-XAMLDialog.

    An XAML Dialog should be possible to load with a built in command and the support for XAML GUIs should be plannend in a long term.

    Started with exemplaric first shot here:
    http://powerintheshell.com/psgui-first-start-3/

    The XAML Dialog must be regexed to catch some errors:
    - removing class
    - using namespace to load the GUI elements
    - Creating variables for all possible GUI elements
    - Replacing / Correcting source-destinations to images etc.
    - Replacing / Correcting relative links
    - may be automatically inserting images as base64 (https://blog.netnerds.net/2015/09/use-base64-for-images-in-powershellwpf-forms/)
    - creating standard dialogs which can easily…

    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 →
  16. $host.ui.prompt default values won't apply

    Votes from Connect: 1

    Original Date Submitted: 8/28/2015 1:18:57 AM

    Description:
    Contact Information
    Handle: ProveIsso
    Site Name: PowerShell
    Feedback ID: 1721069


    Frequency: PowerShell
    Regression: You can use a public example script like this one http://poshcode.org/608
    Result being:

    Key Value


    String Field

    Secure String System.Security.SecureString

    Numeric Value 0

    Problem Description:
    As described by Matt over at StackOverflow - https://stackoverflow.com/questions/26238881/host-ui-prompt-is-ignoring-the-attribute-defaultvalue-in-fielddescription
    > $Host.UI.Prompt method accepts a collection of FieldDescription objects. each of those objects can be assigned with a DefaultValue attribute, which is supposed to be returned when no input is given by the user for this specific field.
    > I've got everything…

    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. limit-eventLog -logname parameter do not accept an array

    Votes from Connect: 3

    Original Date Submitted: 7/22/2015 3:24:55 PM

    Description:
    Contact Information
    Handle: 响叮咚
    Site Name: PowerShell
    Feedback ID: 1576035


    Frequency: PowerShell
    Regression: 【test】
    work:
    limit-eventLog -logname "SYSTEM" -MaximumSize 204800kb

    don't work:
    limit-eventLog -logname @("SYSTEM","Application","Security") -MaximumSize 204800kb
    limit-eventLog -logname "SYSTEM","Application","Security" -MaximumSize 204800kb
    limit-eventLog -logname SYSTEM,Application,Security -MaximumSize 204800kb

    Problem Description:
    limit-eventLog -logname do not accept an array

    【version】
    all version.
    from powershell 2.0 to powershell 5.0 in windows 10 preview 10159!

    【reason】
    manual say:
    -LogName<String[]>, but after I test, does not support string array,only string!

    【The reporter】
    前进三 (QQ No:120944419)
    in
    chinese powershell communication salon ---(QQ group No:183173532)

    Product Studio…

    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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  18. Error when deploying DSC Extension in Azure IaaS VM

    Votes from Connect: 6

    Original Date Submitted: 6/4/2015 6:00:09 AM

    Description:
    Contact Information
    Handle: AlexWeiss
    Site Name: PowerShell
    Feedback ID: 1397136


    Frequency: PowerShell
    Regression: Run a deployment of 10 VMs with a JSON on IaaS V2 using ARM REST API
    These 10 VMs must also have a DSC Extension resource deployed.

    Problem Description:
    Hi Team,

    Wanted to share an error that happens when deploying a VM in Azure using the DSC Extension and Azure Resource Manager.
    When the DSC extension try to install, it needs the WMF5 Preview Update but it receive the error below when installing multiple VM at…

    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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  19. Auto-generated help for CommonParameters should include InformationAction and InformationVariable

    Votes from Connect: 3

    Original Date Submitted: 5/27/2015 6:49:42 AM

    Description:
    Contact Information
    Handle: Joel 'Jaykul' Bennett
    Site Name: PowerShell
    Feedback ID: 1371582


    Frequency: PowerShell
    Regression: get-help Get-Help -Full | Out-String -stream | select-string "^\s+<CommonParameters>" -Context 0,5

    Problem Description:
    When you call Get-Help on a function right now the InformationAction and InformationVariable common parameters aren't mentioned:

    PARAMETERS

    &lt;CommonParameters&gt;
    
    This cmdlet supports the common parameters: Verbose, Debug,
    ErrorAction, ErrorVariable, WarningAction, WarningVariable,
    OutBuffer, PipelineVariable, and OutVariable. For more information, see
    about_CommonParameters (<a rel="nofollow noreferrer" href="http://go.microsoft.com/fwlink/?LinkID=113216)">http://go.microsoft.com/fwlink/?LinkID=113216)</a>.

    Product Studio item created by Connect Synchronizer due to creation of feedback ID 1371582 (http://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=1371582).

    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 →
  20. PowerShell WMF 5 classes lacking

    Votes from Connect: 3

    Original Date Submitted: 5/6/2015 6:00:56 PM

    Description:
    Contact Information
    Handle: FaustoNascimento
    Site Name: PowerShell
    Feedback ID: 1307824


    Problem Description:
    PowerShell are a great introduction to PowerShell, but I feel that they are lacking in a few areas currently:


    • No $PSBoundParameters. With the inability to have fields (rather than properties) in PowerShell classes, and the fact that properties are always public (even with the keyword 'hidden' they can still be accessed externally to the class), it becomes impossible to determine whether a property has a value that is default because of PowerShell's coercion, or if a property…

    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 →
  • Don't see your idea?

Feedback and Knowledge Base