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. Format-Table: Add ForegroundColor and BackgroundColor to a calculated property

    When using calculated properties in Format-Table, you can define:
    - Name/Label (the column heading/calculated property name)
    - Expression
    - Width (define column width)
    - FormatString (to format numbers/strings)
    - Alignment (alignment in table cell/column

    What's missing is a way to output a calculated property in a different color. For example, use red for negative number, green for positive number, and additionally, a way to specify the background color (for the table cell). Adding ForegroundColor (to specify text color) and BackgroundColor (for cell color) to calculated properties would resolve 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  ·  Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
  2. Issue: Verbosity within ScriptsToProcess upon Importing a Module with Verbose switch

    Upon running the Import-Module with the verbose flag my script within "ScriptsToProcess" section contains verbose logging but does not output to the console. I am not sure if this is by design, but I thought by passing in the Verbose option would update the session $VerbosePrefence value and have any verbose logging within the ScriptsToProcess output, but it does not.

    Is this by design? If yes, then what is your suggestion to output the verbose logging?

    My local env:

    Name Value


    PSVersion 4.0

    WSManStackVersion 3.0

    SerializationVersion 1.1.0.1

    CLRVersion 4.0.30319.42000

    BuildVersion 6.3.9600.18773

    PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}

    PSRemotingProtocolVersion 2.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 →
  3. A strange idea: why not work using pipeline objects, e.g. in Add-WindowsCapability?

    Microsoft is proud that PowerShell works with objects and never gets tired of announcing this wonderful achievement everywhere.

    Now I have an apparently extraordinary idea:

    Why does M$ not always and mandatory work with the objects, so that commands of the same subject automatically understand each other?

    This would allow us commands as we expect it. Without googling for solutions... once more. Such commands must simply work:

    Get-WindowsCapability -Online? Name -like' OpenSSH. Client*'. | Add-WindowsCapability

    The current M$ "solution" is that very often we have to handle properties and therefore we fall back to the string handling.

    Annoyoing.
    Very Annoyoing…

    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. write-error writes entire script code to error window before writing the error message

    write-error writes entire script code to error window before writing the error message.

    If you use write-error to write an error message in Azure Automation or in an unsaved script in PowerShell ISE, it will write the entire script to the error stream before writing the actual error message.

    Running this in the PowerShell ISE

    write-verbose "We shouldn't see this in the error stream"
    get-process notepad
    Write-Error -Message "Error"

    Returns this

    PS C:\Users\bmcder> write-verbose "We shouldn't see this in the error stream"
    get-process notepad
    Write-Error -Message "Error"

    Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName


    272      14     3120      14076       1.00
    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. convertfrom-string and rounding

    I have been parsing some log files into JSON type data and have run across a couple of 'issues'. As response is appreciated as I have searched for two weeks and not found any references to these 'issues'.

    Converting the following line results in the truncation of the decimal.

    convertfrom-string "Sat Dec 16 00:00:04 2017 Info: ICID 182588587 REJECT SG BLACKLIST match sbrs[-10.0:-3.0] SBRS -4.4 country United States"

    Results in:
    P1 : Sat
    P2 : Dec
    P3 : 16
    P4 : 00:00:04
    P5 : 2017
    P6 : Info:
    P7 : ICID
    P8 : 182588587
    P9 : REJECT
    P10 : SG …

    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. something killed my directories under PackageManagement - need repair (how ?)

    Something killed my Directory for all Packages.... How can i repair the Powershell-Installation withing Windows 10 ?
    Already tried deactivating / activation of the feature withing windows, sfc /scannow , etc.
    but i cannot use my powershell completely anymore...

    $PSVersionTable

    Name Value


    PSVersion 5.1.15063.786

    PSEdition Desktop

    PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}

    BuildVersion 10.0.15063.786

    CLRVersion 4.0.30319.42000

    WSManStackVersion 3.0

    PSRemotingProtocolVersion 2.3

    SerializationVersion 1.1.0.1

    Example of issue:
    Method invocation failed because [Microsoft.PowerShell.Commands.MatchInfo] does not contain a method named 'Trimstart'.

    so also basics are not even working .....

    can anyone help me ?

    thanks

    Markus

    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 →
  7. DPM's Get-DPMCloudSubscription does not work when run inside a scheduled task.

    If you run a regular DPM report PowerShell script and wish to include the total used space in Azure, the Get-DPMCloudSubscription command fails.

    If you run the script manually you are given the information you need, but the scheduled task reports always show 0 space used. For instance here is the command and result in the ISE:

    SubscriptionName : Azure Backup
    UsedSpace : 272188669250
    TotalSpace : 322122547200
    StorageQueriedTime : 09/01/2018 00:24:02
    RegistrationStatus : AgentInstalledAndRegistered

    but the same part of the report when in a scheduled task shows:
    SubscriptionName : Azure Backup
    UsedSpace : 0
    TotalSpace : 322122547200
    StorageQueriedTime : 09/01/2018…

    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. SSMS 17 - Start Powershell returns 'No SQL Server cmdlets found on this computer' but sqlserver module is installed

    SSMS 17 - Start Powershell returns 'No SQL Server cmdlets found on this computer' but sqlserver module is installed and works outside of SSMS 17

    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. Add Recipient Property 'Capabilities' to be filterable by Set-DynamicDistributionGroup

    When trying to create Dynamic Distribution Groups via Powershell with the Set-DynamicDistributionGroup cmdlet, there are many filterable properties. The properties are supposed to be what you see via 'Get-Recipient'.

    One Property in particular, 'Capabilities' does not appear to be valid for use with Set-DynamicDistributionGroup.

    Could this be added, as it would be very useful to filter people based on what license(s) they have assigned.

    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. Set-DynamicDistributionGroup ProhibitSendReceiveQuota filter doesn't work

    When trying to create a Dynamic Distribution Group via PowerShell using Set-DynamicDistributionGroup, TechNet lists many filterable properties, including 'ProhibitSendReceiveQuota'. However, it doesn't appear to actually work.

    The only way I've gotten it to produce any results is to say:

    Get-Recipient -RecipientPreviewFilter {(ProhibitSendReceiveQuota -lile "*")}

    If you do a 'Get-Recipient', 'ProhibitSendReceiveQuota' isn't even a property returned.

    https://technet.microsoft.com/en-us/library/bb125127(v=exchg.160).aspx

    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 →
  11. get-adcomputer will not bind properly to another function even when it contains a valid string parameter with the 'name' alias.

    Bug filing.

    According to other articles I read this problem may be prevalent in other/all AD cmdlets. To work around this bug you have to use | Select * | as an intermediate step to correctly bind to your $computername/$name parameter.

    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 →
  12. new-service, assign virtual service account

    When creating a new service, I would like to set the user account to a virtual service account. Since the -Credential parameter expects a PSCredential object, which doesn't seem to accept predefined local accounts at all, this isn't currently possible.

    Having a -VirtualAccount switch would be great.

    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. Get-MpPreference .AttackSurfaceReductionRules_Actions returns incorrect value(s)

    Get-MpPreference .AttackSurfaceReductionRules_Actions returns incorrect value(s) compared to registry. Specifically a value of 2 is always returned for rule id BE9BA2D9-53EA-4CDC-84E5-9B1EEEE46550. There may be other anomalies that I haven't yet found for different rule id's.

    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. [bug]register-scheduledjob and new-jobtrigger bug report

    If I scheduled a job for weekly running on specific days it will always fail with error code Task Scheduler stopped instance "{[GUID]}" of task "\Microsoft\Windows\PowerShell\ScheduledJobs[myjob]" as request by user [my windows logon]

    However the job works with the -daily switch. It only fails with -daysofweek

    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-Path returns false for quoted path

    Test-Path returns false for valid paths contained within quotes. See example below. Due to the frequent need to quote paths containing spaces, this leads to needless bugs.

    Repro follows.

    PS C:\WINDOWS\system32> Test-Path 'C:\Windows\System32\ntdll.dll'
    True

    PS C:\WINDOWS\system32> Test-Path '"C:\Windows\System32\ntdll.dll"'
    False

    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. Extend get-childitem with support for file systems exposed via WEBDAV, SFTP, FTP, HTTP

    Extend get-childitem with pluggable support for file systems exposed via HTTP, SCP, SFTP, FTP, WEBDAV.

    Meanwhile, still using curl and custom scripting.

    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. active directory get-adcomputer FQDN

    get-adcomputer accepts FQDNs for the "server" (domain controller) parameter, but doesn't accept them for the "identity" (the adcomputer i'm trying to get-) parameter.

    so

    get-adcomputer -identity domaincontroller
    get-adcomputer -identity domaincontroller -server domaincontroller
    get-adcomputer -identity domaincontroller -server domaincontroller.domain.com

    all work.

    get-adcomputer -identity domaincontroller.domain.com

    does not work.

    what's the logic there?

    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 →
  18. Import-Clixml - Serialized XML is nested too deeply.

    Import-Clixml 'data.xml'

    Import-Clixml : Serialized XML is nested too deeply.
    At line:1 char:1
    + Import-Clixml 'data.xml ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Import-Clixml], XmlException
    
    + FullyQualifiedErrorId : System.Xml.XmlException,Microsoft.PowerShell.Commands.ImportClixmlCommand

    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. Stop-Transcript -ErrorAction doesn't work

    The ErrorAction parameter on Stop-transcript doesn't work.

    for instance with SilenlyContine:

    PS G:> Stop-Transcript -ErrorAction SilentlyContinue
    Stop-Transcript : An error occurred stopping transcription: The host is not currently transcribing.
    At line:1 char:1
    + Stop-Transcript -ErrorAction SilentlyContinue
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [Stop-Transcript], PSInvalidOperationException
    + FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell.Commands.StopTranscriptCommand

    Or with stop:
    Script: Stop-Transcript -ErrorAction Stop; write-output "This message sould not be printed"
    Result: Stop-Transcript : An error occurred stopping transcription: The host is not currently transcribing.
    At home\Untitled4.ps1:1 char:1
    + Stop-Transcript -ErrorAction Stop
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [Stop-Transcript], PSInvalidOperationException
    + FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell.Commands.StopTranscriptCommand

    This message sould…

    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. [Issue] Get-MessageTrace pipe to Get-MessageTraceDetail

    I got some weird data when running below cmdlet

    Get-MessageTrace -StartDate "09/11/2017 00:00:00" -EndDate "09/15/2017 00:00:00" -PageSize 10 -Page 1 | Get-MessageTraceDetail | Select-Object Date, MessageTraceID, Event, Data, Detail | Out-GridView

    It seems the last event of the first MessageTraceID keeps repating itself and was added next to last event of the next MessageTraceID. And its data keep growing. Please see below image for the clear representation of the issue.
    https://1drv.ms/i/s!AtOz2sztWjOapgIwkbjyq-sy4_jm

    Below image is the correct MessageDetail of MessageTraceId 2b87f940-0eee-4c39-71a9-08d4f9757430
    https://1drv.ms/i/s!AtOz2sztWjOapgPFCL102diF6jRz

    And below image is the correct MessageDetail of MessageTraceId f602c9c7-2a5b-4a5a-1256-08d4f8e9ba58
    https://1drv.ms/i/s!AtOz2sztWjOapgSFXfJiKurb23w0

    Can you please check why it is happening?

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

Feedback and Knowledge Base