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. Bug: When defined in an expression, defining a class with references to two other classes throws "Could Not Load Type"

    When importing a module that uses expressions to define custom powershell classes, if a class definition references two or more previously defined, custom powershell classes, PowerShell runtime throws an "Could not load type" exception.

    Version: PowerShell 5.1, Windows 10
    Code to reproduce:
    The below code can either be put into into a module file or run directly in a powershell window:

    Invoke-Expression @'
    
    enum EnumOne {
    One = 1
    Two = 2
    Three = 3
    Four = 4
    }
    '@

    Invoke-Expression @'
    class ClassOne {
    [string]$Property1

    ClassOne([string]$prop1) {
    $this.Property1 = $prop1
    }
    }
    '@

    Invoke-Expression @'
    class ClassTwo {
    [ClassOne]$ClassOne …

    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 →
  2. Windows PowerShell 5.1 hangs displaying result from Invoke-WebRequest

    Entering this reproducibly hangs Windows PowerShell 5.1:

    $r = iwr 'https://marketplace.visualstudio.com/items?itemName=austin.code-gnu-global'
    $r

    Here's what one gets with Set-PSDebug -Trace 2:

    > $r
    DEBUG: 94+ >>>> {
    DEBUG: ! CALL function '<ScriptBlock><DynamicParam>'
    DEBUG: 97+ >>>> $getCommand = $executionContext.InvokeCommand.GetCmdlet(
    DEBUG: ! SET $getCommand = 'Get-Command'.
    DEBUG: 99+ >>>> $foreachObject = $executionContext.InvokeCommand.GetCmdlet(
    DEBUG: ! SET $foreachObject = 'ForEach-Object'.
    DEBUG: 101+ >>>> $whereObject = $executionContext.InvokeCommand.GetCmdlet(
    DEBUG: ! SET $whereObject = 'Where-Object'.
    DEBUG: 107+ >>>> $command = & $getCommand Out-Default -Type Cmdlet
    DEBUG: ! SET $command = 'Out-Default'.
    DEBUG: 108+ >>>> $targetParameters = @{}
    DEBUG: ! SET $targetParameters = 'System.Collections.Hashtable'.
    DEBUG: 109+ >>>>…

    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. Powershell command subommand parameters interactive list with ? button

    A function like cisco devices that show a list of powershell parameters with the ? button:

    Example:
    Restart-Computer -c?

           -computername
    
    -credential
    -others

    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. Powershell "Get-ChildItem -Recurse" does not work on Windows Server 2019

    Win Server 2019 (Azure VM)

    For non-exist dir, powershell print a Windows Defender path.

    Something interesting:


    1. It's fine without "-Recurse" (see the 2nd command in above screenshot)


    2. It's limited to certain path. C:\non-exist-dir cause different output from C:\Program Files\non-exist-dir while D:\non-exist-dir is fine.


    3. There's no issue with existing dir.

    I guess somehow Windows Defender kicks in during powershell execution and did some strange relocation?

    Here's the full log in text form:

    PS C:&gt; Get-ChildItem "${Env:ProgramFiles}/non-exist-dir" -Recurse
    Get-ChildItem : Access to the path 'C:\Program Files\Windows Defender Advanced Threat Protection\Classification\Configuration' is denied.
    At line:1 char:1
    + Get-ChildItem "${Env:ProgramFiles}/non-exist-dir" -Recurse
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    +
    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. cannot run additional paramaters

    Powershell can't seem to run append document files to a command
    using firebase emulators you are required to use
    firbase functions:config:get &gt; .runtimeconfig.json
    this does not work in powershell, only in the raw windows cmdlet
    Reference: https://firebase.google.com/docs/functions/local-emulator#setupfunctionsconfigurationoptional

    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. BUG Using Where-Object? PowerShell 4.0 and 5.1 OK in 2.0

    I really think there is a bug in Where-Object with $_.LastAccessTime
    It always returns Last Write Time, NOT Last Access Time. However, Select-Object works..

    Sample -
    Get-ChildItem -Recurse -Path c:\ | Where-Object {$_.LastAccessTime -le (Get-Date).AddDays(1)}

    Result -

    Mode LastWriteTime Length Name


    ...list of files...

    I have tested with PowerShell 2.0 (Windows 2008 R2) 4.0 (Windows 2012 R2) and 5.1 (Windows 2016 and Windows 10).

    It WORKS as expected on Powershell 2.0

    However, this sample works, but I am unable to finger out how to do anything (like Remove-Item) with the results.

    < save the below as a .ps1 file and…

    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 →
  7. Put CloudShell on Office 365

    Put this directly into the Office 365 Admin console if you are forcing us to use something that never works unless you've become a professional with it AND get all the updates on all the changes that happen in just a single month, so put it directly in Office 365 just like Azure has and YOU keep it updated with the right libraries and modules and all that so when we need to run a command, we don't have to search for 45 minutes to get it going, or when you need to run tech support, you know the platform…

    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. Provide feedback during typing of password

    I just typed my password into a chatroom because although it looked like the PowerShell window had focus, I was entering a password where there is zero feedback. If I had seen a placeholder appear per character like text boxes on websites, I would have been able to tell that the text I was typing was not going to the right window.

    When typing into a password field, I would like to see feedback with something like ******, each * representing a character I typed.

    This is something you can enable with other shells like in this article about Linux,…

    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. Powershell command to show which versions of SSL/TLS enabled and disabled

    Since server 2016 has tls 1.0 -1.2 enabled by default but no corresponding registry keys, admins always feel a little in the dark about whether they are truyl enabled or not, and have to go look it up. It would be great to have a powershell command that showed which versions of TLS or SSL are enabled/disabled, instead of having to use sketchy 3rd party solutions.

    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. Get-Content with cast to [xml] doesn't properly detect encoding of input file

    Get-Content with cast to [xml] doesn't properly detect encoding of input file

    [xml]$xml = Get-Content $sample

    where sample is an UTF-8 file and $xml is in CP-1251

    The expectation is to have encoding detected automatically like it happend in XmlDocument.Load method
    https://docs.microsoft.com/en-us/dotnet/api/system.xml.xmldocument.load?view=netframework-4.8

    Please check attached script with the example of the bug.

    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. Get-Content with cast to [xml] doesn't properly detect encoding of input file

    Get-Content with cast to [xml] doesn't properly detect encoding of input file

    [xml]$xml = Get-Content $sample

    where sample is an UTF-8 file and $xml is in CP-1251

    The expectation is to have encoding detected automatically like it happend in XmlDocument.Load method
    https://docs.microsoft.com/en-us/dotnet/api/system.xml.xmldocument.load?view=netframework-4.8

    Please check attached script with the example of the bug.

    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. OpenSsl fails on the second command in PowerShell

    When trying to execute two openssl commands one by one, the second one fails. I've created a repro on Azure Pipelines demonstrating 4 different cases, by name they are

    1) win2019 fails running:
    openssh help
    openssh help

    on Azure Pipelines hosted pool. This has the specs listed here - https://github.com/actions/virtual-environments/blob/7c96951971ca872b4f02469a3f945af20f517d2b/images/win/Windows2019-Readme.md

    2) default succeeded running:
    openssh help
    openssh help

    on my local box

    3) fromCmd fails running the following from the command prompt:
    powershell -command "openssl help | openssl help"

    4) fromPowerShellToCmd succeeds running the following from PowerShell:
    cmd /c "openssl help && openssl help"

    So basically the only failures happen…

    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. Write-Progress as Advanced Function

    Write-Progress has been discussed recently as adding overhead. What if we added capability to differentiate code:

    1) Not an advanced function: behaves like now
    2) Advanced function: adds a -Progress switch that will only do Write-Progress if it is passed.

    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. Bug: Returning NoteProperty from Functions

    ```
    function TestObject(){
    $MyObject = (Get-Process | select Name) -as [pscustomobject]
    Add-Member -InputObject $MyObject -MemberType NoteProperty -Name "NP0" -Value "Ich bin ein NoteProperty"

    Add-Member -InputObject $MyObject -MemberType MemberSet -Name "SubSet"
    Add-Member -InputObject $MyObject.SubSet -MemberType NoteProperty -Name "NP1" -Value "Ich bin ein NoteProperty"
    Add-Member -InputObject $MyObject.SubSet -MemberType NoteProperty -Name "NP2" -Value "Ich bin ein NoteProperty"

    #This does not work
    #$MyObject

    #This does not work either
    #return $MyObject

    # This works
    Get-Variable -Name MyObject -ValueOnly
    }
    ```

    So basicly you create an object inside a function using a random cmdlet. After that you add NoteProperty members using Add-Member.
    Return that object…

    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. 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 &#39;echo this will crash powershell 1&gt;&amp;2&#39;
    cmd /c &#39;echo this will crash powershell 1&gt;&amp;2&#39;
    cmd /c &#39;echo this will crash powershell 1&gt;&amp;2&#39;
    - job: win2016
    pool:
    vmImage: vs2017-win2016
    steps:
    - powershell: |
    $PSVersionTable
    cmd /c &#39;echo this will crash powershell 1&gt;&amp;2&#39;
    cmd /c &#39;echo this will crash powershell 1&gt;&amp;2&#39;
    cmd /c &#39;echo this will crash powershell 1&gt;&amp;2&#39;

    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 →
  16. 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 →
  17. 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 →
  18. 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 →
  19. 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 →
  20. 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 →
← Previous 1 3 4 5 23 24
  • Don't see your idea?

Feedback and Knowledge Base