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.

Please feel free to provide feedback or file bugs here.

(thinking…)

Enter your idea and we'll search to see if someone has already suggested it.

If a similar idea already exists, you can support and comment on it.

If it doesn't exist, you can post your idea so others can support it.

Enter your idea and we'll search to see if someone has already suggested it.

  • Hot ideas
  • Top ideas
  • New ideas
  • My feedback
  1. "Using module" statement does not reload module after changes are made

    Problem Description
    ------------------
    If you are using the `using module` statement, it will load the module without any issues. However, if you make a change to the module and run the `using module` statement again without restarting your PowerShell session, it will not load the new modified module into memory, and instead will continue to use the old existing module that was loaded. This makes doing development with `using module` statements very tedious as you must continually reload your PowerShell session whenever you make changes to the module.

    Ideally we would just use `Import-Module -Name [module name] -Force` to avoid…

    24 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    2 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  2. RequiredModules statement in Module Manifests should allow for Verbose:$false to be included

    Currently module imports initiated via the RequiredModules statement in a Module Manifest do not allow for verbosity preference.

    This results in a lot of additional noise for end users.
    For example. If a DSC Resource module requires other modules, and imports them via RequiredModules in the Module Manifest then the following happens:

    If an end-user is attempting to troubleshoot their DSC configuration they will utilize

    Start-DscConfiguration -UseExisting -Verbose -Force

    The results will be a verbose line for every cmdlet imported/exported from every included module. Which is A LOT of noise surrounding the verbose messages actually relevant to the end user.

    5 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  3. Remote Invoke-Command with -ScriptBlock changes types of arguments if scripblock contains variables

    What's going on here???

    PS C:\> Invoke-Command -ComputerName somemachine -Credential $cred -ArgumentList {Write-Host hi} -ScriptBlock {param($sb); Write-Host $sb.GetType().Name}
    ScriptBlock
    PS C:\> Invoke-Command -ComputerName somemachine -Credential $cred -ArgumentList {Write-Host hi} -ScriptBlock {param($sb); Write-Host $sb.GetType().Name; $a=3}
    String
    PS C:\> Invoke-Command -ComputerName somemachine -Credential $cred -ArgumentList {Get-ChildItem} -ScriptBlock {param($sb); Write-Host $sb.GetType().Name}
    ScriptBlock
    PS C:\> Invoke-Command -ComputerName somemachine -Credential $cred -ArgumentList {Get-ChildItem} -ScriptBlock {param($sb); Write-Host $sb.GetType().Name; $a=3}
    String

    2 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    5 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  4. "The script failed due to call depth overflow" in non-recursive function

    I have a filter in a script module that a does a little error formatting and flags the fact that it's seen an error. Most of the time, it seems to do its little job just fine. About once a week a sharing violation triggers some kind of infinite recursion and PowerShell emits the depth overflow error. The odd thing is that the function is not recursive. I've run procmon and I can see that the sharing violation happens just once - most of what happens after than is PowerShell writing to a pstrace log (I've wrapped the offending section…

    2 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  5. Unable to paste a Chinese character 𠮷 to PowerShell or output the character from c#.

    I tried command Write-Host "𠮷"(Unicode code point 20BB7) in PowerShell but I am unable to paste the character to PowerShell.
    PowerShell output "?" when I paste the character .
    How can I resolve this issue ? Thank you.
    More details here
    https://social.msdn.microsoft.com/Forums/zh-CN/9accaed3-fcc5-4207-a6fe-5c464a9b7597/how-can-i-output-a-chinese-character-when-its-unicode-code-point-greater-than-65535-in-powershell?forum=win10itprogeneral

    2 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  6. BUG: Shell crashing with x509Certificate2 objects

    Problem:

    When creating an object from the x509Certificate class the shell adds 3 script properties:

    DnsNameList
    EnhancedKeyUsageList
    SendAsTrustedIssuer

    The SendAsTrustedIssuer property causes Powershell to hit a CLR exception and hard crash when accessed.

    Repro Code:

    * Note: do this in a fresh session as it will crash the session

    $Test = New-Object System.Security.Cryptography.x509Certificates.x509Certificate2
    $Test | select *

    Alternately,

    $Test = New-Object System.Security.Cryptography.x509Certificates.x509Certificate2
    $Test.SendAsTrustedIssuer

    Crash dump:

    Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    at System.Management.Automation.Security.NativeMethods.CertGetCertificateContextProperty(IntPtr pCertContext, CertPropertyId dwPropId, IntPtr pvData, Int32& pcbData)
    at Microsoft.PowerShell.Commands.SendAsTrustedIssuerProperty.ReadSendAsTrustedIssuerProperty(X509Certificate2 cert)
    at CallSite.Target(Closure ,…

    4 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  7. Ability to register a wrapper function to be called before a cmdlet is being executed

    Helpful for example to check if remote sessions are still healthy and re-open them in case they are broken.

    1 vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  8. Serious MASSIVE BUG: Mount-DiskImage not scriptable

    Hi

    Mounting a ISO image is happening via Mount-DiskImage -ImagePath C:\ISO\isofile.iso -PassThru. This is working.

    BUT: the -ImagePath parameter doesn´t accept any(!) variables. This makes it absolute and total unusable in a script because usually the Path to a iso isn´t always static.

    If I have an static Path i can use the explorer. Its faster and easier.
    Dissapointing

    1 vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  9. Query path language to query nested hash tables

    Expected:
    Directly use query path language to query nested hash tables

    Current:
    1. Convert the hash table into json
    2. Load json by Newtonsoft.Json
    3. use Json query language to query

    1 vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  10. >> defaults to unicode no matter what the encoding of the original file is

    echo 'hi there' >> file.txt

    Even if file.txt is ansi encoding, this will append a line of unicode or utf-16 little endian text to the bottom of the file. I assume >> is an alias for "out-file -append".

    1 vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  11. 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…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  12. 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:

    $usb_drive = (Get-WmiObject -class Win32_LogicalDisk -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 Win32_LogicalDisk -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 of the local directory (which makes…

    1 vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  13. '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…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  14. Write-Information does not show in a file transcribed by Start-Transcript

    Write-Information does not show in a file transcribed by Start-Transcript unless you set $InformationPreference to 'SilentlyContinue'... which then means it does not display in the console.

    I believe this is a bug in Windows PowerShell (as of v5.1.17134.590) that has been fixed in PowerShell Core? If we cannot go to Core I have to do some workarounds (like using Write-Host or creating a function that combines 2 Write-Information calls with different preferences).

    There looks like a better formatted thread here on this issue:
    https://stackoverflow.com/questions/55191548/write-information-does-not-show-in-a-file-transcribed-by-start-transcript

    Here's $PSVersionTable:
    ---------------------------------------------------------------------------
    PSVersion 5.1.17763.316
    PSEdition Desktop
    PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
    BuildVersion 10.0.17763.316
    CLRVersion 4.0.30319.42000 …

    1 vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  15. "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…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  16. 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…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  17. && and || operators for conditional execution

    Add these essential operators that are an integral part of any other command line language (CMD, Bash, etc.)

    1 vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  18. 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…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  19. 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…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
  20. 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…)
    Password icon
    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 21 22
  • Don't see your idea?

Feedback and Knowledge Base