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. AzureAD - Cannot properly read System.Byte[] value even when loading the module using "-UseWindowsPowerShell".

    AzureAD - Cannot properly read System.Byte[] value even when loading the module using "-UseWindowsPowerShell".

    Whenever I troubleshoot Conditional Access issues, I use to retrieve the certificate hash of AzureADDevice. Long story short, I retrieve "AlternativeSecurityIds.Key" property of AzureADDevice.

    Get-AzureADDevice -SearchString XXXX| fl displayname,deviceid,objectid,@{n='DevCerHash';e={ [System.Text.Encoding]::Unicode.GetString($_.AlternativeSecurityIds.key).substring(21,40) }}

    I know that PS7 isn't compatible with AzureAD module, and for this reason I use "-UseWindowsPowerShell" flag to load the module. Unfortunately, in PS5 the byte array is properly read, while in PS7 (-UseWindowsPowerShell) an object of wrong type is returned.

    Get-AzureADDevice -SearchString XXXX| select AlternativeSecurityIds |gm

    The above command returns "TypeName: Selected.Microsoft.Open.AzureAD.Model.Device" in PS5…

    4 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. Explorer 'Pinned Items' on the taskbar opening in PowerShell 7 rather than explorer

    I have pinned folders to my task bar under Explorer.exe. Since installing PowerShell 7 these links open in PowerShell rather than explorer.

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

    We’ll send you updates on this idea

    1 comment  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
  3. How do I create an Azure Automation schedule with PowerShell using the Az Cmdlet New-AzAutomationSchedule?

    When I attempt to run the Cmdlet below with the following parameters, it fails:

    $AutomationAccountName = "CZEU1-INF-NP-0faa84be-AAA-01"

    $ResourceGroupName = "czeu2-app-np-rgp-01"

    $vmStartTime = (Get-Date "08:00:00").AddDays(1)

    $vmStopTime = (Get-Date "18:00:00")

    $timeZone = [TimeZoneInfo]::Local.DisplayName

    $vmStartupScheduleName = "Startup VMs 08:00 Daily Weekdays:

    $timeZone"

    $vmShutdownScheduleName = "Shutdown VMs 18:00 Daily

    Weekdays: $timeZone"

    [System.DayOfWeek[]]$WeekDays = @([System.DayOfWeek]::Monday..[System.DayOfWeek]::Friday)

    New-AzAutomationSchedule -AutomationAccountName $AutomationAccountName -Name $vmStartupScheduleName -StartTime $vmStartTime -WeekInterval 1 -DaysOfWeek $WeekDays -ResourceGroupName $ResourceGroupName -Verbose

    The error is: New-AzAutomationSchedule : Exception of type 'Microsoft.Azure.Management.Automation.Models.ErrorResponseException' was thrown. At line:1 char:1 + New-AutomationSchedule -AutomationAccountName $AutomationAccountNam... + CategoryInfo : CloseError: (:) [New-AzAutomationSchedule], ErrorResponseException + FullyQualifiedErrorId : Microsoft.Azure.Commands.Automation.Cmdlet.NewAzureAutomationShedule

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

    We’ll send you updates on this idea

    0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
  4. New-ScheduledTaskTrigger missing option to NOT 'Synchronize across time zones'

    New-ScheduledTaskTrigger missing option to NOT 'Synchronize across time zones'

    The default is to always set it. This should not be an implied default as it creates problem with Daylight Saving etc.

    To remove must do as follows which should not be needed:

    $str = Get-ScheduledTask -TaskName TESTTASK

    $NewTriggers = @()
    foreach($trigger in $str.Triggers)
    {

    if($trigger.StartBoundary -match '\+01:00$')
    
    {
    $Trigger.StartBoundary = $Trigger.StartBoundary.Substring(0,$Trigger.StartBoundary.Length-6)
    }
    $NewTriggers += $trigger

    }

    $str.Triggers = $NewTriggers
    Set-ScheduledTask -InputObject $str

    Please add switch to disable either through New-ScheduledTaskTrigger or via Set-ScheduledTask

    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 →
  5. i need powershell to support the sed command

    i need powershell to support the sed command

    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  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
  6. 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 →
  7. 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 →
  8. 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 →
  9. New-AzAutomationConnection Cmdlet incorrectly states that -ResourceGroupName parameter value exeeds length of 90.

    There appears to be a bug when using this Cmdlet, where the -ResourceGroupName parameter incorrectly states that the parameter value for the resource group exceeds a length of 90 when a variable is used, i.e. $rgName (string length is actually 19 <CZEU2-APP-NP-RGP-01>. When the hard coded value of: "CZEU2-APP-NP-RGP-01" is used however, the Cmdlet works as designed.

    13 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 →
  10. How to modify "Date" column in Windows Explorer

    In Windows Explorer there are two columns available: "Date modified" and "Date". I've tried both setting the .LastWriteTime and .CreationTime for files and it changes the date in the "Date Modified" column, but does not change the "Date" column.

    Is there a way to modify the "Date" column in Windows Explorer using Powershell scripting? I basically want to create a "touch" command that will affect BOTH "Date modified" and "Date" columns in Windows Explorer.

    Thanks!

    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  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
  11. I ran command which was executable in cmd but not recognized in Powershell ISE.

    Command which is recognized in cmd but not in Powershell ISE.

    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  ·  ISE and tooling  ·  Flag idea as inappropriate…  ·  Admin →
  12. 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 →
  13. Add-Member unexpected behaviour when adding method to value types

    Trying to alter value with a method:
    $x = 2
    Add-Member -InputObject $x -MemberType ScriptMethod -Name "AlterValue" -Value {param ([int]$NewValue) $NewValue; $this = $NewValue}
    $x.AlterValue(3)
    $x
    No error (even with Set-StrictMode -Version Latest), no update either.

    $y = 'b'
    Add-Member -InputObject $y -MemberType ScriptMethod -Name "AlterValue" -Value {param ([string]$NewValue) $NewValue; $this = $NewValue}
    $y.AlterValue('a')
    Error: Method invocation failed because [System.String] does not contain a method named 'AlterValue'.
    Then trying like this:
    $y | Add-Member -MemberType ScriptMethod -Name "AlterValue" -Value {param ([string]$NewValue) $NewValue; $this = $NewValue}
    Runs without error, but $y.AlterValue('a') results in the same error as above. Same if I…

    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  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
  14. 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 →
  15. Powershell reacts to Lithuanian 9 and 0 in a wrong way starting Windows 1809

    It's not an idea, it's a bug.

    Lithuanian keyboard is known to use the right Alt as AltGr.

    As a top keyboard row in the Lithuanian keyboard layout is Lithuanian characters, holding AltGr allows all the top row to become an English US keyboard again.

    This way, holding AltGr enables to type numbers: 1, 2, 3, 4, 5, 6, 7, 8, 9, 0. But not in Powershell, that ships with Windows 1809. Be it Windows Server 2019 1809, or Windows 10 1809.

    Starting with this Powershell, typing AltGr+9 and AltGr+0 does nothing and this is wrong.

    Typing numbers in 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  ·  ISE and tooling  ·  Flag idea as inappropriate…  ·  Admin →
  16. Sandboxing powershell.exe.config for different versions of PowerShell

    Windows PowerShell.exe supports a -Version command-line switch, which aligns the current PowerShell session to a particular version of PowerShell, e.g. powershell.exe -Version 2.0 will get you a PS shell which uses .NET 2.0 and PowerShell v2. This is still useful, because I still have to write scripts that work in older environments, even though I am running WinPS 5.1 myself.

    However, semi-recent Windows Updates have added configuration to powershell.exe.config (I think to support newer TLS ciphers), which are incompatible with powershell.exe -Version 2.0.

    The following simple code is a minimal test point:

    $wc = New-Object Net.WebClient
    
    $wc.DownloadString(&#39;<a rel="nofollow noreferrer"
    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  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
  17. Please update help for Format-List

    Please update help version of Format-List to PowerShell 5.1

    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  ·  Documentation  ·  Flag idea as inappropriate…  ·  Admin →
  18. gridview tabulation

    Group multiple gridview in one windows.A tabulation system to navigate between grids.

    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  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
  19. MinimumCompatibleVersion still causes "Cannot find module PSDesiredStateConfiguration_1.0 from the server"

    Although a very similar issue has been resolved in WMF5.1 we are encountering an issue when working with partial configurations.

    It seems that the MinimumCompatibleVersion for the complete configurations is taken from the "first" (alphabetical order) partial configuration. If this happens to be a 2.0.0 configuration then other partials which were 1.0.0 cannot load the PSDesiredStateConfiguration module.

    Please take a look at the reproduction in the attachment.
    We reproduced this on windows server 2012r2, 2016 and 2019 and it is causing a very blocking issue for us.

    Edit; since the attachments dont seem to work:

    if (-not $inputCredential)
    {

    $inputCredential
    12 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
  20. Get-DnsServerResourceRecord returns duplicate records when a subzone name matches the parent zone name.

    BUG: Get-DnsServerResourceRecord returns incorrect objects with the FQDN name in the hostname field if the parent zone contains a subzone with the same name.

    Reproduction:

    Setup:
    Create a DNS zone:

     testzone.fake.domain.zzz
    

    Create a sub zone:

     testzone.fake.domain.zzz 
    
    (subzone fqdn: testzone.fake.domain.zzz.testzone.fake.domain.zzz)

    Create an A record:

     Zone Name: 
    
    testzone.fake.domain.zzz (the parent zone)
    Record Name:
    testrecord
    Data:
    10.1.2.3

    Create an A record:

     Zone Name: 
    
    testzone.fake.domain.zzz.testzone.fake.domain.zzz (the subzone)
    Record Name:
    testrecord
    Data:
    10.3.2.1

    Test:
    Get-DnsServerResourceRecord will return these records:
    Item# HostName______________________________________________________ RecordData RecordType

    1 testrecord                                                     10.1.2.3   A
    
    2 &lt;various&gt; &lt;various&gt; &lt;various&gt;
    3 testzone.fake.domain.zzz 10.1.2.3 A
    4 testrecord.testzone.fake.domain.zzz.testzone.fake.domain.zzz 10.3.2.1 A
    5 &lt;various&gt;.testzone.fake.domain.zzz &lt;various&gt; &lt;various&gt;

    Item 1…

    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 →
← Previous 1 3 4 5 86 87
  • Don't see your idea?

Feedback and Knowledge Base