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. Anti human design:about tee-ojbect

    【say】
    This is not a bug, just advice.

    tee-object
    can use -FilePath -Append both!
    can not use -LiteralPath -Append both!

    look:
    Parameter Set: File
    Tee-Object [-FilePath] <String> [-Append] [-InputObject <PSObject> ] [ <CommonParameters>]

    Parameter Set: LiteralFile
    Tee-Object -LiteralPath <String> [-InputObject <PSObject> ] [ <CommonParameters>]

    【reason】
    Anti human design

    【reporter】
    By the chinese powershell study & research group. QQ group No. is 183173532

    【date】
    2016-04-08

    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 →
  2. Microsoft.PowerShell.LocalAccounts confirm impact

    the confirm impact on the Remove* cmdlets in the Microsoft.PowerShell.LocalAccounts module is not set to high.
    I think removing a local group or user (especially when the pipeline is involved) should have Confirm impact set to high to prevent accidental mass deletion

    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  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  3. [Bug] Module identity: #Require throw an exception if the path order change

    I have the following folders :

    Powershell v4

    > tree modules
    C:\TEMP\TEST\MODULES
    ├───Computer1.0
    │ └───Computer
    ├───Computer2.0
    │ └───Computer
    └───Computer3.0

    └───Computer
    

    C:\TEMP\TEST\FABRIKAMMODULES
    ├───Computer1.0
    │ └───Computer
    ├───Computer2.0
    │ └───Computer
    └───Computer3.0

    └───Computer
    

    Powershell v5

    C:\TEMP\TEST\MODULESV5
    └───Computer

    ├───1.0
    
    ├───2.0
    └───3.0

    C:\TEMP\TEST\FABRIKAMMODULESV5
    └───Computer

    ├───1.0
    
    ├───2.0
    └───3.0

    When a use the statement '#Requires -Modules' inside a script :
    #Requires -Modules @{ModuleName="Computer";ModuleVersion='1.0';GUID = '9df5e76c-91a5-46f2-8e3f-1683d42ea1c8' }

    I get an exception 'ScriptRequiresException'.

    Code :
    #---------------
    #..\Modules : GUID = 'a5d7c151-56cf-40a4-839f-0019898eb324'
    #..\FabrikamModules : GUID = '9df5e76c-91a5-46f2-8e3f-1683d42ea1c8'

    $oldPSModulePath=$env:PSModulePath

    $Path=$PSScriptRoot #c:\temp\Tests
    $env:PSModulePath +=";$Path\FabrikamModules\Computer1.0;$Path\Modules\Computer1.0"
    #OR $env:PSModulePath +=";$Path\FabrikamModulesV5;$Path\ModulesV5"

    ipmo -FullyQualifiedName @{ModuleName="Computer";ModuleVersion='1.0';GUID = '9df5e76c-91a5-46f2-8e3f-1683d42ea1c8' }
    Get-module Computer|Select Name,Version,GUID
    # Name Version Guid
    # ---- -------…

    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. Set-UnifiedGroup -identity <name> -HiddenGroupMembershipEnabled:$True (Fails every time)

    I am unable to hide membership of modern groups. Same error every time. I am unable to create and use modern groups for private company purposes.

    We failed to update the unified group. Please try again later.

    + CategoryInfo          : NotSpecified: (:) [Set-UnifiedGroup], TaskException
    
    + FullyQualifiedErrorId : [Server=DM2PR0501MB1309,RequestId=075ee919-1a5a-453d-8f13-7808630a8a4e,TimeStamp=3/30/2016 3:50:16 PM] [FailureCategory=Cmdlet-TaskException] 3AA52605,Microsoft.Exchange.M

    anagement.RecipientTasks.SetUnifiedGroup

    + PSComputerName        : ps.outlook.com
    

    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 →
  5. DirectorySearcher's FindOne method returns data more slowly than FindAll.

    Please consider reviewing the underlying code and optimizing the DirectorySearcher .NET Class for performance.

    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  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  6. Need PowerShell native alternatives to "cmd /c assoc" / "cmd /c ftype"

    Interacting with filetype associations in PowerShell today requires using "cmd /c assoc" and "cmd /c ftype", which involves nice quoting / parsing constraints.

    Native PowerShell mechanisms would be way better.

    One possible source of inspiration: http://www.mkssoftware.com/docs/man1/assoc.1.asp / http://www.mkssoftware.com/docs/man1/ftype.1.asp

    6 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 →
  7. BUG: Remove-Item "Incorrect function" error for Remote to Remote Symbolic Links

    In Powershell 5 the ability to create/delete links (SymbolicLink, HardLink or Junction) was introduced using new-item and remove-item. However remove-item does not work for remote to remote symbolic links.

    Remote to remote symbolic links are typically not enabled by default. They can be enabled by doing:
    fsutil behavior set SymlinkEvaluation R2R:1

    Issue can be replicated by doing:
    fsutil behavior set SymlinkEvaluation R2R:1
    sl "\$servername\$servershare\$serverpath"
    new-item Data -ItemType Directory
    new-item DataPtr -ItemType SymbolicLink -Target Data
    remove-item DataPtr -force -Recurse

    This generates the error:
    remove-item : Incorrect function

    Workaround is to do:

    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 →
  8. Impossible to set -RunOnlyIfIdle flag

    New-ScheduledTaskSettingsSet -RunOnlyIfIdle doesn’t do anything. Fixing that wouldn’t really help either as we’d need an idle task trigger as well. I documented all the problems at the below link, and really hope this could be sorted out.
    https://www.slightfuture.com/devel/idle-task-scheduler-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  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  9. PS ConstrainedLanguage mode on Windows 10 with SRP

    We have Windows 10 computers (PS version 5) with SRP (Software Restriction Policy) enabled.

    We realized that when we have PS Version 5 and SRP enabled, the system will put PowerShell into ConstrainedLanguage mode, which prevents some of our PS scripts to run in the user context.

    If we try other combinations we can see that things works:
    -If we start the PS with elevated admin rights, then PS in admin context run in FullLanguage mode.
    -If we disable SRP, then PS in user context will run in FullLanguage mode.
    -If we run PS Version 4 (Win 7 or 8)…

    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 →
  10. invoke-command and get-adcomputer

    As it stands because Get-ADComputer uses the name property and invoke-command uses the Computername property results from Get-ADComputer cannot be piped in directly to the invoke-command cmdlet. Adding aliases for one or both properties to make them work together seamlessly would be great.

    6 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 →
  11. Get-Credential Smart Card Across Domains

    When using New-PSSession -ComputerName -Credential (Get-Credential) and specifying a smart card certificate, authentication fails.

    The smart card option seems to pull my credentials from the domain my workstation is on (Alpha\Username) instead of passing the smart card certificate forward to be authenticated as (Bravo\Username).

    Is there a way to change or prevent this?

    Scenario:
    Username = "User"
    Workstation Domain = "Alpha"
    Server Domain = "Bravo"
    User is logged into his workstation and attempts to authenticate to his server in Bravo using his smart card. User's authentication is denied. The logs on the Server indicate that "Alpha\User" was denied access.

    This…

    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  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  12. Get-ChildItem and Test-Path on IIS:\SslBindings can fail to show SNI bindings

    On IIS8

    After Importing the WebAdministration module and using Get-ChildItem and Test-Path against IIS:\SslBindings I find it gives it can give inconsistent results.

    If I create a new site with only an SNI SSL binding and try to enumerate the SSL bindings using either

    Test-Path IIS:\SslBindings!443!my.test.site
    (which will return false)
    or
    Get-ChildItem -Path IIS:\SslBindings\
    (which can fail to return the SNI bindings)

    Adding a HTTP binding to the IIS site makes these SNI SslBindings visible (it can be removed afterwards).

    This does not occur using netsh http show sslcert which seems to return the information reliably.

    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 →
  13. Make ad-hoc use of Get-WinEvent easier

    Being a longtime user of PowerShell, I am used to using Get-EventLog at the command line to quickly check the event log entries. I have tried the same specific scenarios where I use Get-EventLog at the command line but with Get-WinEvent instead and they are much more complicated. For example, it's just so easy to:

    Get-EventLog System -Newest 20 -EntryType Warning,Error

    Comparitively speaking, the same functionality can be had with Get-WinEvent with this syntax, although it is much less intuitive:

    Get-WinEvent -FilterHashtable @{LogName='System';Level=@(1,2)} -MaxEvents 20

    Note that I only came up with this syntax after figuring out the integer equivalents…

    6 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 →
  14. Accept NuGet Interval Notation for Specifying Version Numbers

    When attempting to load a module by fully qualified module name, PowerShell should allow for a single "ModuleVersion" field that accepts NuGet's interval notation for specifying ranges. This change could be added without breaking change as this spec (in interval notation):

    $fqn = @{ModuleName='BingWallpaper';ModuleVersion='1.0'}

    Tells PowerShell to load any module >= 1.0 which is backwards compatible with how PowerShell would interpret that version string today. But if I wanted to follow semver rules, I could specify:

    $fqn = @{ModuleName='BingWallpaper';ModuleVersion='[1.0,2.0)'}

    Which says load any matching module >= 1.0 but < 2.0.

    The interval notation is quite expressive. See the NuGet docs…

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

    We’ll send you updates on this idea

    2 comments  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →

    We understand that this would allow a single-point expression of MinimumVersion and MaximumVersion. However, it’s unclear why changing to that nomenclature going to be a high priority. Additional information, particularly about why the existing functionality is insufficient – would help – thanks!

  15. BUG: ScheduledTasks module broken in 1511

    ICAN use New-SchedualedTaskTrigger -AtSartup without error SO THAT I can schedule tasks

    Repeat issue: update win10 to 1511 and run this command in PowerShell
    New-ScheduledTaskTrigger -AtStartup
    New-ScheduledTaskTrigger : Method "NewTriggerByStartup" not found
    At line:1 char:1
    + New-ScheduledTaskTrigger -AtStartup
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : ObjectNotFound: (PS_ScheduledTask:Root/Microsoft/...S_ScheduledTask) [New-ScheduledTaskTrigger], CimException
    
    + FullyQualifiedErrorId : HRESULT 0x80041002,New-ScheduledTaskTrigger

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

    We’ll send you updates on this idea

    7 comments  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  16. [System.ServiceProcess.ServiceController] should add StartType to its formatting

    Get-Service | Format-List
    Get-Service | Format-Table

    should display the "StartType" column, i.e. "StartType" should appear in "System.ServiceProcess.ServiceController" <TableControl> and <ListControl> in DotNetTypes.format.ps1xml.

    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  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  17. Start-Transcript: poor error message on a bad -Path

    The following command

    Start-Transcript \zz*\z.log
    

    produces an error

    Start-Transcript : Transcription cannot be started.
    
    At C:\tmp\_160209_203322\test.ps1:2 char:1
    + Start-Transcript \zz*\z.log
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [Start-Transcript], PSInvalidOperationException
    + FullyQualifiedErrorId : CannotStartTranscription,Microsoft.PowerShell.Commands.StartTranscriptCommand

    The reason of the error is a bad -Path argument.
    It is difficult to get this from the error information.

    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  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  18. v5 regression: Get-ChildItem -LiteralPath -Recurse ignores -Include and gets all items

    I have just installed Windows Management Framework (WMF) 5.0 RTM on my Windows
    7 SP1 and tested it. Get-ChildItem -LiteralPath -Include -Recurse started to
    work differently in v5.

    This command

    Get-ChildItem -Path $PSHOME -Include *.exe -Recurse
    

    gets expected powershell.exe and powershell_ise.exe.

    The same command with -LiteralPath instead of -Path

    Get-ChildItem -LiteralPath $PSHOME -Include *.exe -Recurse
    

    in PowerShell v5 RTM unexpectedly gets all items in $PSHOME.

    I cannot test this with previous versions right now (by the way,
    PowerShell.exe -Version 2 seems to have the same issue in v5 RTM). But I
    believe in PowerShell v3 and v4 this…

    19 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 →
  19. performance of out-null drastically worse then using [void] or assigning result to $null

    Votes from Connect: 4

    Original Date Submitted: 3/28/2015 6:08:31 AM

    Description:
    Contact Information
    Handle: JasonHorner
    Site Name: PowerShell
    Feedback ID: 1208677


    Frequency: PowerShell
    Regression: gci | out-null
    void

    $null = gci

    run the above inside of measure-command the problem gets worse as the number of iteration increase

    Problem Description:
    It seems to me that:

    gci | out-null

    should be the preferred way of expressing: discard output in PowerShell

    However when running timings against alternatives
    some of the the other constructs are much faster:

    void

    $null = gci

    I realize this is likely due to the pipeline overhead. Would it be…

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

    We’ll send you updates on this idea

    2 comments  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  20. Test-Connection should support suppressing errors and returning the full result objects

    Use case:

    Test-Connection (1..15 | % { "comp{0:00}" -f $ }) -Count 1 | select Address, IPV4Address, ResponseTime, @{Name='Success'; Expression={$.StatusCode -eq 0}} | ft

    Currently, the code above will produce a table with successful pings, interleaved with error records for unreachable machines. It would be very useful to be able to provide a switch so that Test-Connection would return objects with appropriate status instead of errors.

    As an icing on the cake, the objects returned by Test-Connection could be extended with a bool Success property, calculated based on StatusCode (like in the example above).

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

Feedback and Knowledge Base