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. saya sangat terbantu dengan adanya halaman ini

    ini sangat praktis dan mudan untuk dimengerti TY

    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 →
  2. Bug: Format-Hex Does not display single zero byte

    Format-Hex does not display output with a source of a single zero byte or byte array with a single zero byte:

    Repro:

    [byte]$byte = 0
    $byte | Format-Hex # no value displayed
    [byte[]]$bytes = 0
    $bytes | Format-Hex # no value displayed

    [byte]$byte = 1
    $byte | Format-Hex # correct 01 value displayed
    [byte[]]$bytes = 1
    $bytes | Format-Hex # correct 01 value displayed

    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 →
  3. Test-ModuleManifest returns incorrect Tags when run multiple times

    If you run the Test-ModuleManifest cmdlet more than once against the same manifest the "Tags" property returns different results each time.

    For example, I have a module that contains the following tags in the psd1 file:

    Tags = "tag1","tag2"

    You can see below that if run the Test-ModuleManifest more than once it returns more copies of the tags each time it's executed:

    $m = Test-ModuleManifest .\tagtest.psd1
    $m.tags
    tag1
    tag2
    tag1
    tag2

    $m = Test-ModuleManifest .\tagtest.psd1
    $m.tags
    tag1
    tag2
    tag1
    tag2
    tag1
    tag2

    $m = Test-ModuleManifest .\tagtest.psd1
    $m.tags
    tag1
    tag2
    tag1
    tag2
    tag1
    tag2
    tag1
    tag2

    $m = $null
    $m =…

    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 →
  4. Connect-MicrosoftTeams from Microsoft Teams PowerShell does not work on Azure Automation

    I am attempting to connect to Microsoft Teams using Azure Automation. I am using the following code in Azure Automation PowerShell Runbook.

    ```

    Get the credential from Automation

    $credential = Get-AutomationPSCredential -Name 'O365'

    $userName = $credential.UserName

    $securePassword = $credential.Password

    $psCredential = New-Object –TypeName System.Management.Automation.PSCredential –ArgumentList $userName, $securePassword

    Connect to Microsoft Teams

    Connect-MicrosoftTeams -Credential $psCredential
    ```

    I receive the following error:

    ```
    Connect-MicrosoftTeams : One or more errors occurred.: Object reference not set to an instance of an object.
    At line:9 char:1
    + Connect-MicrosoftTeams -Credential $psCredential
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : AuthenticationError: (:) [Connect-MicrosoftTeams], AadAuthenticationFailedException
    
    + FullyQualifiedErrorId : Connect-MicrosoftTeams,Microsoft.Open.Teams.CommonLibrary.ConnectMicrosoftTeams

    Connect-MicrosoftTeams :…

    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 →
  5. Get-NetFirewallRule does not show ports or IPs

    There is no obvious way to dump the CURRENT rule used by the firewall that includes the port(s) and IP(s) assigned to 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  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  6. get-hotfix

    Get-Hotfix doesn't display all installed hotfixes on a computer (verified in Server 2012r2, Server 2016, Server 2019 and Windows 10 v1909).

    It feels like (unverified) that it is pulling this info from WMI, because similar wmi queries also miss the same updates (wmic qfe list).

    I've found that running this code, actually gives the list of all installed updates:

    $Session = New-Object -ComObject "Microsoft.Update.Session"
    $Searcher = $Session.CreateUpdateSearcher()
    $Searcher.QueryHistory(0, $Searcher.GetTotalHistoryCount())

    Request Get-Hotfix be updated to pull in this missing info and output it in a friendly way much like it does already.

    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 →
  7. Why I have to create a path if not present using Move-Item

    Why we need to create a path prior to moving a file from one location to other, if the destination doesn't have the relative path created using Move-item in powershell scripting.

    For e.g. I have a source path as "E:\abc\0000\xyz.txt" and destination where it should be copied has a folder "D:\vfd". Now with Move Item I need to copy the xyz.txt using relative path as

    Move-Item "E:\abc\0000\xyz.txt" -Destination "D:\vfd\0000\xyz.txt"

    Now the above command will error since Destination doesn't have the 0000 directory.

    In Unix if destination path is not present then it creates the required path and move the item.…

    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. Remove-Variable unexpected behaviour when the same variable name is created with the same value

    Code run first:
    $x = 2
    Add-Member -InputObject $x -MemberType ScriptMethod -Name "Get" -Value {$this}
    $x.Get()
    Remove-Variable x
    $x
    Error: The variable '$x' cannot be retrieved because it has not been set.

    Trying again:
    $x = 2
    Add-Member -InputObject $x -MemberType ScriptMethod -Name "Get" -Value {$this}
    Error: Add-Member : Cannot add a member with the name "Get" because a member with that name already exists.
    $x.Get()
    Remove-Variable x
    Error: The variable '$x' cannot be retrieved because it has not been set.

    $x = 1
    $x.Get()
    Error: Method invocation failed because [System.Int32] does not contain a method named 'Get'.

    So 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  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  9. Compress-Archive | handle if directory contains symbolic link(s)

    Copying directories that contain sub-directories that contain symbolic links... Getting "Access to path '{path}' is denied". Was using Get-ChildItem to exclude a directory and tried to use it to ignore symbolic links but it seems like it not play nice with -Recurse.. Cant Compress-Archive just ignore symbolic links?

    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. Get-Service -ComputerName not supported anymore?

    Get-Service used to support a ComputerName parameter so that I can connect to a remote server and get the services from there. Is it no longer supported in PS7? I saw a suggestion to run the script remotely on each server where you want to get the services from, which is highly impractical and slow too.

    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 →
  11. How can i write logs to single file using foreach-object parallel?

    Issue
    I am trying to write logs to a single log file using the PSlogging PowerShell module.

    The Script is using the Foreach-object parallel.

    The script works, But sometimes the script gets stuck in between.

    Please help me to resolve it? Is there a better way to achieve this?

    Powershell core 7

    code

    ```
    $sScriptVersion = '1.0'

    $sScriptVersion = '1.0'
    $sLogName = 'custom.log'
    $sLogPath = "C:\Users\Dixon\Desktop\automation\azure\log"
    $sLogFile = Join-Path -Path $sLogPath -ChildPath $sLogName

    Start-Log -LogPath $sLogPath -LogName $sLogName -ScriptVersion $sScriptVersion

    $allServers = $(Get-AzVM -Status)

    try {

    $allServers | ForEach-Object -parallel {
    
    

    $sScriptVersion = '1.0'
    $sLogName = "parallel-" + $_.Name +".log" …

    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 →
  12. 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. Transcription logs data which is not visible in the console

    discovered on windows 10 (1809) with powershell 5.

    Name Value


    PSVersion 5.1.17763.1007
    PSEdition Desktop
    PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
    BuildVersion 10.0.17763.1007
    CLRVersion 4.0.30319.42000
    WSManStackVersion 3.0
    PSRemotingProtocolVersion 2.3
    SerializationVersion 1.1.0.1

    steps to reproduce from a command prompt:

    powershell -noprofile
    start-transcript
    try{get-command -name 'boom' -erroraction 'stop'} catch{}
    stop-transcript
    exit

    the command prompt correctly shows no indication of an error, since the error was caught.

    the transcript will incorrectly show an indication of an error with a line starting ">> TerminatingError".

    this behavior does not exist in powershell 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  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  14. Get-AuthenticodeSignature only returns first Signature

    Get-AuthenticodeSignature only returns the 1st digital signature listed. There can be multiple signatures for a file which can be seen via the file properties.

    We should either return a list of signatures or introduce a separate List-AuthenticodeSignature which will allow systems to properly inspect all signatures.

    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 →
  15. Test-NetConnection - Please Add Switch to Skip Ping, Too Slow With Ping

    On many networks ICMP traffic is dropped, which makes waiting for an ICMP ping pointless. Please change the default behavior to skip the ping test, and/or add a switch to skip the ping test. Test-NetConnection is too slow when querying more than a couple ports on a host.

    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 →
  16. [Bug] Flaw in Cmdlet Where-Object: Unexpected output for option -LT when entering a wrong property name

    Hello there, not too sure where to post my findings as this is my first time reporting a Windows bug, so I hope I chose the right category.

    I discovered a potential bug in the Cmdlet Where-Object which involves the -LT option and misspelling the selection property. I reproduced the error on a clean VM of Windows 10 (please refer to the images attached), although I initially noticed this bug in Windows Server 2016. Instead of no output due to the wrong spelling of the property "Length", the initial output of the command piped into Where-Object is listed. This might…

    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 →
  17. add-appxpackage does not have -user option.

    add it so we can add those packages to specific user without logging in to that specific user.

    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 →
  18. Get-Content -Head and -Tail doesn't work well on large files

    I want to look a few lines of a large file, but Get-Content with -Head and -Tail option still reports insufficient memory issue.

    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 →
  19. Cannot change Temp folder path used fora Exchange Online Power-Shell Module imports

    Cannot change Temp folder path used for Exchange Online Power-Shell Module (With MFA) imports. How do we change the path from using the temp folder

    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 →
  20. Get-DnsClient and Get-DnsClientServerAddress output format incorrect

    I feedback with https://github.com/PowerShell/PowerShell/issues/10987

    Get-DnsClient and Get-DnsClientServerAddress output format incorrect.You can see the markdown render of github issue.

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

Feedback and Knowledge Base