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. -IgnoreCertificateCheck or -SkipSslVerification parameter for [Invoke-WebRequest & Invoke-RestMethod]

    Invoke-WebRequest & Invoke-RestMethod need a parameter to easily skip/ignore checking for a valid certificate of https uri's. This could be required for a number of reasons such as development site only using self signed certificate while testing.

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

    We’ll send you updates on this idea

    survey  ·  1 comment  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  2. Should Save-Script download all modules defined as dependencies or not?

    Right now, when you run the Save-Script command you end up with a script and all its module dependencies. In my case, I only wanted a script and got 100+ MB of modules too. :(

    It would be better if you introduce the -IncludeModules parameter, and by default only download a script with the Save-Script.

    Downloading the modules with the script makes sense for Install-Script, but not so much with Save-Script, in my opinion.

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

    We’ll send you updates on this idea

    survey  ·  5 comments  ·  Package Management  ·  Flag idea as inappropriate…  ·  Admin →
  3. Provide means to qualify Script names to avoid conflicts

    Hello!

    The PowerShell Gallery currently qualifies 'Scripts' by name only. For example, if someone has already published Some-Script, I have no way to publish my own Some-Script, even if the original is related only in name, has major functional differences, etc.

    It would be helpful to allow qualifying these. Perhaps resolve by date published first (i.e. compatible with current system), while allowing qualification by username, similar to how GitHub handles this.

    Thus, I could install RamblingCookieMonster\Some-Script, even if EvilDoer\Some-Script already existed.

    The same design could also be extended to modules, although those seem less likely to conflict (this may change…

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

    We’ll send you updates on this idea

    survey  ·  4 comments  ·  PowerShell Gallery  ·  Flag idea as inappropriate…  ·  Admin →
  4. Powershell Core should have a nuget package for release

    It would be awesome if powershell core was released as a package on nuget.org as well as the regular means.

    The reason for this is build systems like cake build can have tools referenced via nuget packages and will pull them down as part of the build.

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

    We’ll send you updates on this idea

    survey  ·  0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
  5. Problem with scope in PowerShell

    If you run following snippet of code in PowerShell, variable $i and $l will be accessible in the global scope after the loop has exited.
    for($i=1; $i -le 3; $i++){$l = $i}

    Typically in programming languages, neither variable should be visible in global scope, only in the loop scope. There has been many instances where I have forgotten this is a thing in PowerShell and it has bitten me in the face in the form of runtime errors.

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

    We’ll send you updates on this idea

    survey  ·  2 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  6. Add IsWindows to PS5.1 to allow cleaner code

    PowerShell for Linux and OSX added IsLinux, IsOSX, and IsCore (?). IsWindows was added for PowerShellCore.

    Can you add IsWindows to allow cleaner code to not have to assume if it is False for Linux,OSX,Core, it's full Windows (not nano), etc?

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

    We’ll send you updates on this idea

    survey  ·  1 comment  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
  7. Tab completion should complete Verb then Noun

    With hundreds of CmdLets, tab-completion becomes arduous. This could have a new mode that's two step, so I type:

    Reg [tab]

    Which completes "Register-" and waits for more input.

    Then I type:

    ps [tab]

    Which completes the rest to make "Register-PSRepository".

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

    We’ll send you updates on this idea

    survey  ·  1 comment  ·  ISE and tooling  ·  Flag idea as inappropriate…  ·  Admin →
  8. Invoke-WebRequest returned object hangs when accessing Links property

    OS: Windows 7 - 10

    Name : ConsoleHost
    Version : 5.0.10586.117
    InstanceId : 078d4e23-84fd-433c-a831-37bb0935166e
    UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
    CurrentCulture : en-US
    CurrentUICulture : en-US
    PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
    DebuggerEnabled : True
    IsRunspacePushed : False
    Runspace : System.Management.Automation.Runspaces.LocalRunspace


    Not working example:

    $releases = 'https://github.com/hluk/CopyQ/releases'
    $downloadpage = Invoke-WebRequest -Uri $releases -UseBasicParsing
    $download
    page.links # <-- hangs here

    Other properties seem to work normally.


    This example uses basic parsing and works without out. However, the behavior doesn't generally depend on this setting and I had sites that hang on many occasions.

    The following issues seems related:

    https://windowsserver.uservoice.com/forums/301869-powershell/suggestions/11088744-invoke-webrequest-hangs-in-some-cases-unless-use
    https://windowsserver.uservoice.com/forums/301869-powershell/suggestions/11515881-invoke-webrequest-hangs-freeze-at-many-websites

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

    We’ll send you updates on this idea

    survey  ·  4 comments  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  9. BUG: new-localuser fails to allow connection to Microsoft account

    The New-LocalUser cmdlet available in Windows 10 Anniversary Update cannot perform a function described in the documentation.

    Local user accounts may be connected with existing Microsoft accounts. New-LocalUser should support this by accepting a -Name parameter of the form "MicrosoftAccount&lt;user>@outlook.com". This is described in the detailed help.

    However this fails because the parameter fails validation as it is over 20 characters in length (already true with "MicrosoftAccount&quot; and "@outlook.com" let alone the "actual" user name). The 20 character limit is valid for a regular local account name, but shouldn't be valid for an MS account name.

    There appears no other…

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

    We’ll send you updates on this idea

    survey  ·  3 comments  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  10. Get-PSSessionCapability returns capabilities even when the speficied user doesn't have permissions to connect to the session

    The documentation on Get-PSSessionCapability states it returns information (capabilities) on the session configuration the specified username has on it, but it also returns it for a SessionConfiguration (created with a pssc file) when it wasn't created with a RoleDefinition, no matter if the specified user can or cannot access it.
    I would expect it not to return any information for that SessionConfiguration, or have a property that indicates the specified doesn't have the required permissions (invoke / fullcontrol).

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

    We’ll send you updates on this idea

    survey  ·  1 comment  ·  WinRM  ·  Flag idea as inappropriate…  ·  Admin →
  11. Bug in Show-Command

    Scriptblock parameters are interpreted as a [bool] value and is shown as a listbox with values $true or $false

    Code to reproduce:

    Show-Command -Name Invoke-Command

    Scriptblock parameter is shown as a [bool] listbox

    Cheers

    Tore

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

    We’ll send you updates on this idea

    survey  ·  1 comment  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  12. Negation operator isn't IEEE floating point compliant

    $a = 0.0 ; $b = -$a ; $c = -1.0*$a

    1.0 / $b

    should produce [double]::NegativeInfinity but produces [double]::PositiveInfinity instead

    1.0 / $c

    this correctly produces [double]::NegativeInfinity

    It looks like PowerShell implements "-$a" as "0 - $a" which is incorrect for floating point types.

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

    We’ll send you updates on this idea

    survey  ·  0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  13. Add a Duration column to the History output

    The output of Get-History has Start and End times which can be put together to calculate a Duration. Why not add that to the default formatting of history objects?

    As a workaround, I use these:
    https://gist.github.com/Jaykul/2d4dc5e4f5195c726368435055b8acdb

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

    We’ll send you updates on this idea

    survey  ·  1 comment  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  14. BUG: PSBoundParameters contains values from PREVIOUS pipeline input

    When writing functions that take ValueFromPipelineByPropertyName, and accepting pipeline input, if some of the pipeline input is missing some properties, PSBoundParameters contains the previous value... incorrectly reporting the parameter was passed in:

    For example:

    function Get-UserName {
    [CmdletBinding()]
    param(

    [Parameter(ValueFromPipelineByPropertyName,Mandatory)]
    
    $Last,

    [Parameter(ValueFromPipelineByPropertyName)]
    $First

    )
    process {

    if($PSBoundParameters.ContainsKey(&#39;First&#39;)) {
    
    Write-Host -Foreground Red $PSBoundParameters[&#39;First&#39;] $PSBoundParameters[&#39;Last&#39;] &quot; &quot; -NoNewLine
    $First[0] + $Last
    } else {
    $Last
    }

    }
    }

    $Users = [PSCustomObject]@{ First = "Ethan"; Last = "Hunt" }, [PSCustomObject]@{ First = "Jason"; Last = "Bourne" }, [PSCustomObject]@{ Last = "Bond" }

    $Users | Get-UserName

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

    We’ll send you updates on this idea

    survey  ·  0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  15. Treat empty arrays as constants

    PowerShell's constant expression analyzer should recognize empty arrays as constants. i.e. these two should work:

    { param([ValidateSet(@())]$a) }

    Set-Variable -Option Constant emptyArray @()
    { param([ValidateSet($emptyArray)]$a) }

    Rather than complaining that empty arrays aren't constants.

    And the following should be much faster:

    @() should be equivalent to the constant Array.Empty<object>()

    Measure-Command { foreach ($null in 0..10000000) { $null = @() } }

    [int[]]@() should be equivalent to the constant Array.Empty<int>()

    Measure-Command { foreach ($null in 0..10000000) { $null = [int[]]@() } }

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

    We’ll send you updates on this idea

    survey  ·  0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  16. BUG: ScheduledTaskTrigger -RandomDelay does not work

    New-ScheduledTaskTrigger -AtLogOn -RandomDelay 0:15:00; or
    New-ScheduledTaskTrigger -AtLogOn -RandomDelay (new-Timespan -Minutes 15)
    does not set the delay option. The checkbox in ScheduledTask Panel never gets set.
    Windows 10.0.14393 x64 de-DE (German Installation)

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

    We’ll send you updates on this idea

    survey  ·  2 comments  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  17. ValidateSet doesn't accept constants like it says it does

    When running the below script on Windows 10 PowerShell 5.0.10586.494, it crashes with an error stating that the argument isn't a constant even though it is:

    Set-Variable -Option Constant ConstantVariable 'c'
    Set-Variable -Option Constant ConstantArrayVariable @('c')

    function Test-ValidateSet {

    param(
    
    [ValidateSet($ConstantVariable)]
    $p1,

    [ValidateSet($ConstantArrayVariable)]
    $p2
    )

    }

    At C:\tmp\Test-ValidateSet.ps1:7 char:22
    + [ValidateSet($ConstantVariable)]
    + ~~~~~~~~~~~~~~~~~
    Attribute argument must be a constant or a script block.
    At C:\tmp\Test-ValidateSet.ps1:10 char:22
    + [ValidateSet($ConstantArrayVariable)]
    + ~~~~~~~~~~~~~~~~~~~~~~
    Attribute argument must be a constant or a script block.

    + CategoryInfo          : ParserError: (:) [], ParseException
    
    + FullyQualifiedErrorId : ParameterAttributeArgumentNeedsToBeConstantOrScriptBlock

    This is an important feature for me because I…

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

    We’ll send you updates on this idea

    survey  ·  0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  18. Node with large configurations fails to send status report to the Report Server

    Testing out WMF 5.0 and when I tried one of our existing configurations, which has a good amount of resources in it, the following error is logged in the event log after each consistency check:

    Job {%JobID%} :
    Http Client {%AgentID%} failed for WebReportManager for configuration The attempt to send status report to the server https://johntestx02/PSDSCPullServer.svc/Nodes(AgentId={%AgentID%}')/SendReport returned unexpected response code RequestEntityTooLarge..

    I assume this is because of the amount of resources the node is trying to report on back to the report server. Has anyone else run into this? Can the Report Server configuration be adjusted to accept lager amounts…

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

    We’ll send you updates on this idea

    survey  ·  3 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  19. Allow using Select, Sort, Group, and Measure without a pipeple

    It should be possible to use Select-Object, Sort-Object, Group-Object, and Measure-Object without a pipeline.

    In those circumstances where a script needs to be optimized for speed, one of the first things to do is to eliminate pipelines because of the huge overhead they incur. Because of these four commands, eliminating all pipelines is sometimes impossible or requires coming up with complex alternatives to them.

    I would expect these two commands (or some variation of the second one) to produce the same result:

    2, 1, 3 | Sort-Object
    Sort-Object -InputObject 2, 1, 3

    Currently, the second line treats the array in…

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

    We’ll send you updates on this idea

    survey  ·  0 comments  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  20. Get-ComputerInfo most properties are empty

    I try the new CMDLet Get-ComputerInfo, but the most properties in the result are empty.
    Only this properties show values:
    WindowsBuildLabEx,WindowsCurrentVersion,WindowsEditionId,WindowsInstallationType,WindowsInstallDateFromRegistry,WindowsProductId,WindowsProductName,WindowsRegisteredOrganization,WindowsRegisteredOwner,WindowsSystemRoot,TimeZone,LogonServer,PowerPlatformRole,DeviceGuardSmartStatus

    Try also as Admin and with different Hardware and VM's. (Windows 10 x64 Versiom 1607)

    Beste regards
    brima

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

    We’ll send you updates on this idea

    survey  ·  2 comments  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  • Don't see your idea?

Feedback and Knowledge Base