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. Powershell 5.1.17763.1007 on Windows 2019 stops with NativeCommandError on Azure Pipelines

    How to reproduce:

    With this Azure pipelines yaml snippets:

    The special character are all encoded. And when I attach a file I get 500 error. Please see https://gist.github.com/chenbojian/6fcb3a8c3bbe42cc2851a1eefe9f4324

    - job: win2019
    
    pool:
    vmImage: windows-2019
    steps:
    - powershell: |
    $PSVersionTable
    cmd /c 'echo this will crash powershell 1>&2'
    cmd /c 'echo this will crash powershell 1>&2'
    cmd /c 'echo this will crash powershell 1>&2'
    - job: win2016
    pool:
    vmImage: vs2017-win2016
    steps:
    - powershell: |
    $PSVersionTable
    cmd /c 'echo this will crash powershell 1>&2'
    cmd /c 'echo this will crash powershell 1>&2'
    cmd /c 'echo this will crash powershell 1>&2'

    The win2019…

    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 →
  2. ValidateScript does not work for class properties

    ValidateScript does not work for class properties. All other validating seem to work.

    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 →
  3. Typing with Shift is not working in non-English keyboard layout

    In PowerShell console in Windows 10 there is a serious problem that prevents entering capitalized letters (i.e. pressing Shift+Letter does nothing). This happens with most but not all letters and depends on the keyboard layout that was active when PowerShell console was started. If PowerShell console is started with English (US) keyboard layout, than typing in English works without problems (only Shift+Space not work, but I see another issue about it). After switching to Russian keyboard layout, most letters with Shift not work. Only ЦУШЩХЪФЫСТ can be typed. But when PowerShell console is started with Russian keyboard layout, it is…

    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 →
  4. Powershell console regularly stucks when run from other console

    Issue:
    when I start new powershell process under different account from running powershell console (using start-process) consoles often freeze for several seconds/minutes. This doesn't happen if I start second console from START menu (using run as different user).

    I also noticed, that they somehow "synchronize" as can be seen on this video https://www.dropbox.com/s/9iq6bs9snxqlpba/PSstuckproblem.mp4?dl=0
    So when I start typing in first console, the second one (which is stucked at that moment) start typing chars, that are in queue or whatever...on its own

    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 →
  5. Disable or Restrict Powershell -EncodedCommand

    Powershell is targeted more often as a vector for breaching computer systems. Script signing prevents malicious use of scripted payloads, but an encoded command allows for complex command sequences to be executed in an obfuscated manner, outside of behavior based detection mechanism. Security Groups are calling for disabling of Powershell altogether because there are not security controls to lock down specific features. Disabling Encodedcommand for standard users would at least be a start to breaking the methodologies of those seeking to breach security by leveraging command and control utilities.

    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. Powershell much slower in export to excel

    I am using a script to export a configuration to excel
    running this scipt in powershell 7 (7.0.0) is much slower than in the native powershell for windows 10 (5.1.18362.628).
    This scipt can be found https://github.com/skippernl/Fortigate2Excel
    What could be the cause of 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 →
  7. "using module" does not provide a way to disable name checking

    The Import-Module cmdlet provides a way to silence the warning about unapproved verbs in function/cmdlet names (-DisableNameChecking). There does not seem to be a way to do this via the "using module" statement, which generates unwanted noise (we have our own internal naming conventions).

    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 →
  8. Get-ChildItem -Recurse -Attributes Directory lists $RECYCLE.BIN

    Hello!

    With Powershell 6, my target ist to list all folders.

    I find no way to exclude $RECYCLE.BIN
    :
    Get-ChildItem -LiteralPath 'D:' -Recurse -Attributes !Hidden+!System+!ReadOnly+!Encrypted+!IntegrityStream+Directory `

    -ErrorAction SilentlyContinue
    

    Thank You for advice me

    Erhie

    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 →
  9. 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 →
  10. 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 →
  11. 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 →
  12. 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 →
  13. 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 →
  14. 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 →
  15. 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 →
  16. 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 →
  17. 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

    3 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  18. 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 →
  19. 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 →
  20. 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 →
← Previous 1 3 4 5 22 23
  • Don't see your idea?

Feedback and Knowledge Base