# 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.
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. ## Enable configuration version tracking for compiled DSC configurations

As a part of infrastructure as code or using DSC in the deployment pipelines, it is desired that we be able to identify the version of the node configuration. With all configurations being put into a source / version control repository, it won't be difficult to promote the version number for a given configuration document. However, at this point in time, there is no way to specify the version of the configuration document itself anywhere. This makes it hard to determine or identify what version of the configuration is being used on a target node without using a 3rd party…

Check!
(thinking…)
Reset
Signed in as (Sign out)

We’ll send you updates on this idea

• ## Support for NPM type version strings in PowerShell module manifest

packages.json in NPM (NodeJS in general) supports prefixes in the version string to specify a minimum required with minor and minor/patch versions being a variable. For example,

The tilde matches the most recent minor version (the middle number). ~1.2.3 will match all 1.2.x versions but won't match 1.3.0.

The caret provides better flexibility. It will refer to the most recent major version (the first number). ^1.2.3 will match any 1.x.x release including 1.3.0, but will hold off on 2.0.0.

Also, an asterisk (*) indicates that the latest version of the module is needed.

Implementing this type of version specification in…

Check!
(thinking…)
Reset
Signed in as (Sign out)

We’ll send you updates on this idea

• ## Some new default cmdlet parameters?

We have -ErrorVariable and -WarningVariable. To capture verbose output to a variable, you can $VerboseRecords = (Write-Verbose -Verbose "test") 4>&1 # and find it in$VerboseRecords.Message, but wouldn't it make sense to add a -VerboseVariable? Maybe even a -WriteHostVariable?

1 vote
Check!
(thinking…)
Reset
Signed in as (Sign out)

We’ll send you updates on this idea

• ## [Bug] Bitwise AND operation on long value is ignored when Most-Significant 32 bits is masked with zero

[Bug] Bitwise AND operation on long value is ignored when Most-Significant 32 bits is masked with zero

Sample Code to replicate issue:

[BitConverter]::GetBytes([BitConverter]::ToInt64(@(1,1,168,192,255,255,255,255), 0) -band 0x00000000ffffffff)

Should return: @(1,1,168,192,0,0,0,0)
Actually returns : @(1,1,168,192,255,255,255,255)

Check!
(thinking…)
Reset
Signed in as (Sign out)

We’ll send you updates on this idea

• ## PowerShell ISE 5.1 is crashing during initialization

PowerShell ISE 5.1 is crashing during initialization, i.e., when the SPLASH-SCREEN is still visible.

Please, see my other bug report: PowerShell ISE crashes after latest Windows Update

Other relevant informations, are:

1- System is Windows 7 Starter SP1

2- $PSVersionTable Name Value ---- ----- PSVersion 5.1.14409.1012 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.14409.1012 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 3- The only 2 events logged into APPLICATION event-log are: EventID : 1001 MachineName : FREELANCERCOMPUTER Data : {} Index : 85373 Category : (0) CategoryNumber : 0 EntryType : Information Message : Fault bucket , type… 1 vote Sign in Check! (thinking…) Reset or sign in with I agree to the terms of service Signed in as (Sign out) We’ll send you updates on this idea • ## BUG: PowerShell stderr redirect to file inserts newlines If I run the following command in PowerShell:$ .\long_error_message.exe 2>error.txt

, I get spurious newlines in error.txt. I generated a full repro and extremely clumsy solution at [1]. Can we declare this behavior as a bug? Note that cmd.exe operates exactly as one would expect.

Check!
(thinking…)
Reset
Signed in as (Sign out)

We’ll send you updates on this idea

• ## 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.

Check!
(thinking…)
Reset
Signed in as (Sign out)

We’ll send you updates on this idea

• ## Notification option for authors when publishing to PS Gallery

When an author publishes an update to their module hosted on the gallery it should provide an option to push a notification to their configured social media accounts.

So an author configures Twitter and LinkedIn profiles on their account/profile. A configuration option within the module being published should allow for a setting that will push a notification to their social media, on their behalf, announcing a new release of that module.

Check!
(thinking…)
Reset
Signed in as (Sign out)

We’ll send you updates on this idea

• ## 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 Check! (thinking…) Reset or sign in with I agree to the terms of service Signed in as (Sign out) We’ll send you updates on this idea • ## utf-8 without bom Bug: Scripts encoded with utf-8 without bom are producing errors when the character "Ä" is used between double quotation marks. Frequency: always How to reproduce: Create a powershell file with the following contents:$test = "Ä"

Save it with the encoding "utf-8 without bom" (often just called utf-8. The counterpart, utf-8 with bom, can also be called "utf-8 signature").

Run the file, and you will get the following error:

At C:\location\to\file\test.ps1:1 char:9
+ $test = "Ã„" + ~~~~ The string is missing the terminator: ". + CategoryInfo : ParserError: (:) [], ParseException + FullyQualifiedErrorId : TerminatorExpectedAtEndOfString 2 votes Sign in Check! (thinking…) Reset or sign in with I agree to the terms of service Signed in as (Sign out) We’ll send you updates on this idea • ## Add support for Conditions on DSC Resources Currently the only way to apply conditions is using the Script resource. However the Script Resource has limitations especially when dealing with Azure credential objects. Conditions would be very useful, similar to what SCCM uses for it's Configuration Items. Syntax would be: Condition = [Boolean PowerShell Expression] Example #1: Apply a Package Resource only for SQL servers Example #2: Apply a WindowsFeature Resource only for IIS servers. 3 votes Sign in Check! (thinking…) Reset or sign in with I agree to the terms of service Signed in as (Sign out) We’ll send you updates on this idea • ## Add-Content should create folder but returns error According to this documentation Add-Content should create a folder when it does not exist: "This command creates a new directory and file and copies the content of an existing file to the newly created file." https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/add-content?view=powershell-5.1 However, I get an error: "Add-Content : Could not find a part of the path 'C:\tests\test134\logs\test134.log'." Seems like a clear issue to me. Either in the documentation or the functionality. BR Matthias 1 vote Sign in Check! (thinking…) Reset or sign in with I agree to the terms of service Signed in as (Sign out) We’ll send you updates on this idea • ## Powershell 5 documentation for command Where-Object has a typo Example 4 in help documentation for Where command has a typo (-GEe): Example 4: Use the comparison statement format PS C:\>Get-Process | Where-Object -Property Handles -GE -Value 1000 PS C:\> Get-Process | where Handles -GEe 1000 2 votes Sign in Check! (thinking…) Reset or sign in with I agree to the terms of service Signed in as (Sign out) We’ll send you updates on this idea • ## BUG: binary module loading fails silently on Fall Creators update on some machines occurs in PS 5.1 on Windows 10, Fall Creators update First observed with SqlServer module 21.0.17199 Also occurs with PsWindowsUpdate v2.0.0.0 , SqlServer 21.0.17224 Pretty much what it says - with either autoload or Import-Module, the module loads with no complaints but the cmdlets aren't there. The assemblies _do_ get loaded into the appdomain. I found no obvious clues poking around with ProcMon and Trace-Command (obvious to me, anyway). Happens on some machines, not others. Reported by 3 users (that I know of), in each case after updating to the Fall Creators update. If you have any debugging hints, they'd… 1 vote Sign in Check! (thinking…) Reset or sign in with I agree to the terms of service Signed in as (Sign out) We’ll send you updates on this idea • ## Get-Acl WebDAV error because of @SSL After connecting to a SharePoint Online site or a OneDrive 4 Business site as a external drive (https://support.microsoft.com/en-us/help/2616712/how-to-configure-and-to-troubleshoot-mapped-network-drives-that-connec) you get an code 1 error when executing Get-Acl on this WebDAV path. I assume is because of the @ssl part in the path. Steps to reproduce: Get-Acl -Path \customer-my.sharepoint.com**@ssl**\DavWWWRoot\personal\user_customer_com\Documents Expected behavior: Acl's are returned for the item (file or folder). Actual behavior: error code 1 is returned. "Get-Acl : Method failed with unexpected error code 1." 1 vote Sign in Check! (thinking…) Reset or sign in with I agree to the terms of service Signed in as (Sign out) We’ll send you updates on this idea • ## Fix the typo in the shortcut of PowerShell Core 6 for Windows This shouldn't take more than one minute of the developer's time, right? 1 vote Sign in Check! (thinking…) Reset or sign in with I agree to the terms of service Signed in as (Sign out) We’ll send you updates on this idea • ## 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 ------- ------ ----- ----- ------… 1 vote Sign in Check! (thinking…) Reset or sign in with I agree to the terms of service Signed in as (Sign out) We’ll send you updates on this idea • ## 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… 1 vote Sign in Check! (thinking…) Reset or sign in with I agree to the terms of service Signed in as (Sign out) We’ll send you updates on this idea • ## [Bug] DSC configuration allows multiple resource instances with duplicate key values Before PowerShell 5.1, compilation of DSC configurations having resource instances with duplicate keys resulted in a compilation error. However, with 5.1, this seems to have changed. Configuration FileDemo { Import-DscResource -ModuleName PSDesiredStateConfiguration -ModuleVersion 1.1 Node Localhost { File TestFile1 { DestinationPath = 'C:\Scripts\Test.txt' Contents = '' Type = 'File' } File TestFile2 { DestinationPath = 'C:\Scripts\Test.txt' Contents = '' Type = 'File' } } } FileDemo This configuration will compile with no errors. PS C:\>$PSVersionTable

Name Value
---- -----
PSVersion 5.1.14393.1914
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.1914
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

1 vote
Check!
(thinking…)
Reset
Signed in as (Sign out)

We’ll send you updates on this idea

• ## Find-Package does not search all sources if -Source parameter is not supplied

I have cross posted this to the PowerShell core repo too as the same issue exists in v6 https://github.com/PowerShell/PowerShell/issues/6100

to reproduce:

Register-PackageSource -Name "nugetv2" -ProviderName NuGet -Location "http://www.nuget.org/api/v2/&quot;

get-packagesource

Name ProviderName IsTrusted Location
---- ------------ --------- --------
nuget.org NuGet False https://api.nuget.org/v3/index.json
nugetv2 NuGet False http://www.nuget.org/api/v2/
PSGallery PowerShellGet False https://www.powershellgallery.com/api/v2/

Find-Package npgsql

expected:
result returned with or without -source nugetv2

This is on Powershell 5.1 on windows 8.1

Name Value
---- -----
PSVersion 5.1.144
PSEdition Desktop
PSCompatibleVersions {1.0, 2
BuildVersion 10.0.14

1 vote
Check!
(thinking…)
Reset