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. Allow expansion of columns in output

    For example, I type in Get-PrinterPort and press return. It shows me the output for all printers. However, I have one printer with a port (defined by Windows) as a really really long text string. The output in Powershell truncates it which renders the output utterly useless. I need a way to have output non-truncated

    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. powershell get-childitem works unexpected differently

    Hi there

    Im working with WindowsPE and have to identify my USB-Drive.

    So I´m looking for the drive and assign a variable:

    $usbdrive = (Get-WmiObject -class Win32LogicalDisk -filter DriveType=2 | Foreach {Get-ChildItem -Filter *.wim -r -d 1 $.DeviceID} 2>$null | Where {$.name -eq "boot.wim"}).PsDrive.Root

    With Powershell 5.1.14393.2791 its working as expected. With 5.1.18361.1 not.

    The reason is this part:

    Get-WmiObject -class Win32LogicalDisk -filter DriveType=2 | Foreach {Get-ChildItem -Filter *.wim -r -d 1 $.DeviceID}

    The Reason is handling of $_.Deviceid. On both versions the Result is c:

    On both versions Get-Childitem C: gets the entries…

    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. 'Using module' does not work when having multiple levels of inheritance

    When having more than one level of inheritance, 'Using module' does not work as expected.

    Example:

    Class A is defined in module A.
    Class B is defined in module B.
    Class C is defined in module C.

    A.psm1
    class A {}

    B.psm1
    Using module 'A'

    class B : A {}

    C.psm1
    Using module 'B'

    class C : B {}

    With the above example class C only inherits the properties and methods from B class and not from A class.

    The reason for separating the classes in different modules is to allow their reuse in other modules.

    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. Backport Powershell 6.x to Windows Powershell

    To keep Windows Powershell up to date please backport any new features from Powershell 6.x to Windows Powershell.

    7 votes
    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. "using module" does not take variable as parameter

    The "using module" statement does not take a variable as a parameter for the module name, which is inconvenient if you're writing scripts based on taking modules from variable DFS paths based on the environment (usign different Active Directory forests as the root for the paths for instance).

    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. Merge "Windows PowerShell" and "PowerShell Core", make result default on Windows

    When sending code to someone, I don't want to have to qualify the post with "if it doesn't work, try the other PowerShell...". I know there will be OS-specific modules/commands, but there should not be two code bases for the shell itself, or two product names.

    15 votes
    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. Move-AzureRmDataLakeStoreItem not working in newer versions of module

    I created a runbook on several automation accounts that move around files and folders on Datalake Storage Accounts (gen 1). The runbook works without hitches on 2 automation accounts, but did not work on the other 2.

    There were quite a few differences in the versions of the added modules: the runbook worked on the older versions of the modules, but not the newer. Specifically the cmdlet Move-AzureRmDataLakeStoreItem threw an error on the newer versions:
    "Account name ***.azuredatalakestore.net/ is invalid. Specify the full account including the domain name."

    After trying quite a few iterations of writing the account name (just…

    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. ERROR: Select-Object with -First parameter populates -ErrorVariable even if there was no error

    If you run: 1..2 | select -ErrorVariable a
    then $a is empty - OK.

    If you run: 1..2 | select -First 2 -ErrorVariable a
    then in $a is "System error"

    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. Private methods in powershell class's don't work

    For reference: https://docs.microsoft.com/en-us/powershell/wmf/5.0/class_newtype#methods

    Creating private methods following the documentation does not work. To reproduce follow the following steps:


    • Open Powershell or the ISE

    • Copy the code from microsoft documentation

    • if ISE: The interface will alarm indicating problems

    • Execute documented test code

    • Observe several errors complaining about code syntax and missing brackets.

    You can also repro by adding the private designation to any working method of an existing class and it will bomb.

    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 →
  10. SMTPEventConsumer doesnt format message body properly

    I found a bug in PS 4.0 when working with SMTPEventConsumers. The bug I found truncated the string used for the "Message" property of the SMTPEventConsumer. The code truncated anything after the first 16 characters. It didn't matter what I used for an escape sequence, formatted as here string, nothing worked. I ran the exact same code on a PS 5.1 host and the SMTP message was formatted exactly as expected. For more indepth info I have included a link to the thread I started on TechNet for this issue.

    https://social.technet.microsoft.com/Forums/en-US/62c4552b-b5e8-4bf3-ac74-6c5f1668af9f/issues-properly-formatting-smtpeventconsumer-message-body-in-powershell?forum=ITCG

    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. Transfer $DebugPreference and $VerbosePreference to New-PSSession

    I want a PSSessionOption that says to transfer over common applicable session level variables over to the remote session, specifically $DebugPreference and $VerbosePreference.
    $DebugPreference = 'continue'
    $PSSession = New-PSSession -ComputerName 'localhost'
    Write-Debug $DebugPreference # Writes 'continue'
    Invoke-Command -ScriptBlock {Write-Debug $DebugPreference} -Session $PSSession # Writes nothing

    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. Inconsistent Array Initialization Behaviour

    Creating an array of arrays as below works well:

    $myArray = @(
    
    @(1,2,3),
    @(4,5,6)
    )
    $myArray[0] #outputs 1, 2, 3
    $myArray[1] #outputs 4, 5, 6

    $myBuggyArray = @(
    @(1,2,3)
    ,@(4,5,6)
    )
    $myBuggyArray[0] #outputs 1
    $myBuggyArray[3] #outputs 4, 5, 6

    I wouldn't expect the order of line break & comma to impact the behaviour of the command / can't find any documentation stating that it should.

    PSVersion: 5.1.14409.1012

    8 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 →
  13. Bug: -Exclude does not work as -Include does in Get-ChildItem, or as expected

    Three folders; d1, d2, d3, with files test.txt and test.mp3 in in d1 and d3.

    '-Include d1' includes only content from d1. Would expect '-Exclude d1' to include the inverse, but it has no effect, it returns all data.

    unless it's run after -Include.

    So '-Include d1 -Exclude d1' returns nothing, as expected.

    Exclude only works as it applies to a file name, not a path.

    So '-Exclude .txt' will exclude all files '.txt' as expected.

    The syntax usage in the help file is identical for both parameters.

    Please fix -Exclude parameter so that it works…

    3 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 →
  14. format-volume whatif

    format-volume with option -whatif not working. It's should "Shows what would happen if the cmdlet runs. The cmdlet is NOT RUN."

    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 →
  15. Add 'StopExisting' as a valid argument for New-ScheduledSettingsSet -MultipleInstances

    Only Parallel, Queue, and IgnoreNew are supported right now. One would expect that the option available from the Task Scheduler GUI would be available in the powershell interface.

    Steps to reproduce

    $a = New-ScheduledTaskSettingsSet -MultipleInstances StopExisting

    Expected behavior

    The task's multiple instances policy is set to kill existing tasks before starting another instance.
    Actual behavior

    value "StopExisting" to type "Microsoft.PowerShell.Cmdletization.GeneratedTypes.ScheduledTask.MultipleInstancesEnum".
    Error: "Unable to match the identifier name StopExisting to a valid enumerator name. Specify one of the following
    enumerator names and try again:
    Parallel, Queue, IgnoreNew"
    At line:1 char:131
    + ... ngOnBatteries -ExecutionTimeLimit $b -MultipleInstances StopExisting
    + ~~~~~~~~~~~~

    + CategoryInfo
    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  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  16. copy-item progress

    Add an optional switch to show the progress of an ongoing copy operation. Could be useful for large operation. Basically replicate as much information as the Explorer does, without the performance graph.

    13 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 →
  17. Classes do not support data hiding.

    I am grateful for the addition of classes in PS, and I know why PowerShell classes do not support true data hiding, but it is a significant shortcoming. It does not allow full control of setting a property for example. I can write my own class method for setting it, but it can be changed outside of that method. And if that method also updates the value of another class property, it can get changed directly, without going through the desired logic so the class method can be bypassed.
    And it is nice to have the get and set automatically…

    2 votes
    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. Remote powershell should not return error for FileSystem validation

    SCENARIO
    On Machine1:
    SCHTASKS /Create /RU SYSTEM /SC ONSTART /TN "Map I drive" /TR "net use I: \someServer\someShare somePassword /user:someDomain\someUser"

    On Machine2 run:
    $Script = { Write-Output "Hello world!" }
    Invoke-Command -ComputerName Machine1 -ScriptBlock $Script

    As a result you get "Hello world!" but also an error
    "Attempting to perform the InitializeDefaultDrives operation on the 'FileSystem' provider failed."

    The error belongs to I drive which should have been returned as a warning and not error. The invoke does not even use the I drive so why fail on it (we in this case dont even want the invoke to have access…

    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 →
  19. Transcript does not log the Verbose and Warning stream of Receive-Job

    Problem

    When we run a job inside a transcript, the Verbose and the Warning streams of the jobs are not displayed in the transcript. However, we can see the in the console correctly.

    Steps to reproduce

    Run the following script
    Start-Transcript -Path 'C:\Logs\DemoJobsTranscriptOutput.txt' -Append | Out-Null

    $VerbosePreference = "continue"
    $WarningPreference = "continue"

    $jobs = @()

    $jobs += Start-Job -ScriptBlock {

    $VerbosePreference = "continue"
    
    $WarningPreference = "continue"
    "Begin job"
    Write-Verbose "Verbose!"
    Write-Warning "Warning!"
    "End job"

    } -Name "Demo"

    $jobs | Wait-Job | Out-Null

    $jobs | % {

    "Result for job '$($_.Name)'"
    
    $_ | Receive-Job -Verbose

    }

    $jobs | Remove-Job | Out-Null

    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 →
  20. PowerShell StackOverFlowException: get-childitem -path HKLM:\ -recurse -include *Windows*

    PowerShell has a bug in it which causes a "StackOverFlowException" when running the following command:
    get-childitem -path HKLM:\ -recurse -include Windows

    It was originally reproduced while looking for something different than:
    Windows

    This is consistently reproducible in latest updates applied of Windows 10 x64 Business and Home, with both PowerShell.exe, and ISE, x86 and standard.

    $PSVersionTable.PSVersion

    Major Minor Build Revision


    5 1 16299 98

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

Feedback and Knowledge Base