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. Chocolatey's refreshenv should be first-party

    Make the Chocolatey refreshenv part of Powershell. Manipulating environment variables is very difficult without it.

    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 →
  2. Provide PublishedName in printmanagement cmdlet

    pnputil provides the PublishedName property. This can come in handy in rare cases where Windows does not properly register and unregister a driver.

    This is what I am looking for:

    Microsoft PnP Utility

    Adding driver package: cnp60ma64.inf
    Driver package added successfully.
    Published Name: oem20.inf <---- need this
    Driver package installed.

    Total driver packages: 1
    Added driver packages: 1

    Unfortunately, the printmanagement cmdlet does not provide this functionality when adding or enumerating driver objects. Add-WindowsDriver and Get-WindowsDriver do, but you can only use Add-WindowsDriver on offline images at the moment.

    Is there any plan to enhance or change this?

    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 →
  3. Remove-PrinterDriver with -Force option

    The Remove-PrinterDriver cmdlet currently does not offer a -Force option. This becomes a problem when there are network printers mapped via Group Policy that use the driver. When this is the case, PowerShell will return a "The specified driver is in use by one or more printers" error.

    PnPUtil offers the ability to force delete a driver even if it is in use. PowerShell's Remove-PrinterDriver cmdlet should offer the same behavior (clearly it is possible).

    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 →
  4. SET - ProtectedFromAccidentalDeletion

    Get-ADcomputer -filter 'Name -like "SRV_*"' -Properties ProtectedFromAccidentalDeletion | Set-ADObject -ProtectedfromaccidentialDeletion $false

    Get-ADcomputer -filter 'Name -like "SRV_*"' -Properties ProtectedFromAccidentalDeletion | Set-ADComputer -ProtectedfromaccidentialDeletion $false

    Set-ADComputer : Es wurde kein Parameter gefunden, der dem Parameternamen
    "ProtectedfromaccidentialDeletion" entspricht.
    In Zeile:1 Zeichen:106
    + ... Set-ADComputer -ProtectedfromaccidentialDeletion $false
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidArgument: (:) [Set-ADComputer], Parameter
    

    BindingException

    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.ActiveDirectory
    

    .Management.Commands.SetADComputer

    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. XXXUDPORACLEANORDIQUEBEASTARAPTORONTOCLOCKIRKLANDROSOPHITLEROMARSATUROVIRG0ALUDPOPEYELLEFTWINGAYARDLINEART©P/IP143&144MASMENDREDICCMELEDFER

    J'OFFRAMANOVOIDATAPIGUTAGRAISSEALIMENTORONTOCOLLORACLEFLAG0ADACHAUTEARTIGAYOURSELFERLANDOMARSAMPLEADERSSQLITORISHTARROWHADOWASPDEAUQIONCHINM

    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. Memory leaks while using powershell runspace in .NET

    I found a huge memory leak in project which appears after execution PS command. Here I create example that represent my problem in "TestCase" comment.

    After memory usage investigation I found that most of memory occupied by inner structures from System.Management.Automation. So I start to search the way to release resources and found that the same behavior can be reproduced in PS:
    Get-Module -ListAvailable | ForEach { Import-Module $_.Name }
    Get-Command -ListImported -CommandType Cmdlet,Alias

    I already have tried to initiated garbage collecting and to remove all new variables that appears after script execution. I even have tried to start new…

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

    We’ll send you updates on this idea

    2 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  7. BUG: sort in pipeline don't work correctly

    Hi

    When you use the sort function in a pipeline it will work in ISE but not when you run the script direktly (see attached logs). By run it dierktly it sorts the objects wrong.

    Greetings from Germany

    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. SEHException

    I can't use power shell. If I open it, print these error
    ハンドルされていない例外: System.Runtime.InteropServices.SEHException: 外部コンポーネントが例外をスローしました。
    場所 System.Reflection.RuntimeAssembly.GetResource(RuntimeAssembly assembly, String resourceName, UInt64& length, StackCrawlMarkHandle stackMark, Boolean skipSecurityCheck)
    場所 System.Reflection.RuntimeAssembly.GetManifestResourceStream(String name, StackCrawlMark& stackMark, Boolean skipSecurityCheck)
    場所 System.Resources.ManifestBasedResourceGroveler.GetManifestResourceStream(RuntimeAssembly satellite, String fileName, StackCrawlMark& stackMark)
    場所 System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
    場所 System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
    場所 System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
    場所 System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
    場所 System.Management.Automation.Internal.PipelineProcessor.Start(Boolean incomingStream)
    場所 System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)
    場所 System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper()
    場所 System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc()
    場所 System.Management.Automation.Runspaces.PipelineThread.WorkerProc()
    場所 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    場所 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state,…

    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 →
  9. Start-Job on Windows Server 2016 hangs Powershell

    Start-Job seems to sometimes cause the calling thread to hang. If you create a loop in ISE and spin off a bunch of jobs, inevitably it will hang. This has only been tested using a ScriptBlock.

    As a workaround, you can use threads to do the heavy lifting and so if they fail to start the job, just recreate the thread.

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

    We’ll send you updates on this idea

    2 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  10. Powershell Pipe is not respecting the AllParameterSets value

    .

    Repro: using the following script:

    function Test 
    
    {
    [CmdletBinding()]

    Param(
    [string]$name,

    [Parameter(Mandatory = $True, ParameterSetName = &quot;Set1&quot;)]
    [Parameter(Mandatory = $True, ParameterSetName = &quot;Set2&quot;)]
    [string] $P1,

    [Parameter(Mandatory = $True, ParameterSetName = &quot;Set2&quot;)]
    [string] $P2

    )

    Write-Output ($name + &quot; - &quot; + $PsCmdlet.ParameterSetName)

    }

    The following Fails! e.g. Powershell doesn't resolve to ParameterSet "Set1"

    'aaa' | Test -P1 x

    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. profile.ps1 doesnt load when Windows Powershell 2.0 engine was disabled.

    We have been using automation script for our deployment. We are using the latest version of System.Management.Automation.

    System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35

    We have few modules referred in profile.ps1 which automatically loads when we execute the ps1 files. This works fine if we have enabled Windows Powershell 2.0 engine.

    If we disable Windows Powershell 2.0 Engine this doesnt load the profile.ps1 in $pshome and scripts throws functions not found error.

    This seems to be weird behavior as all our scripts still works with Powershell 5.1

    Would need your attention to help fixing this or provide a solution to fix this.

    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. Filesystem PSProvider Doesn't Handle Folder with Trailing Space

    *-Item -Path "$home\try \it.txt" fails, even if "$home\try " exists. Note trailing space character after folder name.

    This has been observed for New-Item (using -Force), Get-Item, Get-ChildItem.

    This is on Windows 10 Enterprise versions

    PSH: 5.1.17763.592 + Winver: 1809 build 17763.678

    PSH: 5.1.18362.145 + Winver: 1903 build 18362.295

    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 →
  13. New request -- get-winevent :get all log generated by a specific user

    If I try to find when the user abc.cd logon to my computer.
    I will do a log query as follow.
    Get-WinEvent -FilterHashtable @{logname='security';data='abc.cd';id=4624}

    If I want to know when a software was install on computer.
    I will do a log query as follow.
    Get-WinEvent -FilterHashtable @{logname='application';id=11707}

    but It does not work with a user ID as follow.
    Get-WinEvent -FilterHashtable @{logname='application';id=11707;data='abc.cd'}

    What I do I want is collectting all logs that caused by the user abc.cd by using get-winevent , like he installs a new software , he starts a service ,he starts a scheduled task ..

    expected cmdlet:
    Get-WinEvent…

    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 →
  14. 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 →
  15. 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.



    Actual behavior

    Miss out…

    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. 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 →
  17. 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 →
  18. 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 →
  19. 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 →
  20. 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 HKEYCURRENTUSER\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' and the…

    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