# 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. ## Catch illegal syntax in array definition

Today I had an issue where getting an element at a certain index in a typed array failed. As I was troubleshooting this issue I found that it was simply because I had used a '.' (dot) instead of a ',' (comma) to separate the elements when I defined the typed array variable.
Okay, that is a clear mistake on my part. However, as I thought about it I would have loved to be alerted by the Powershell engine .

-- Experienced on v5.1.14409.1012 of PowerShell
-- Win7 x64 OS

TO REPRODUCE:

open vscode
create ps1 file
$array = "hej",… 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] Drag and drop to scripts shortcuts split paths containing spaces Drag and dropping any file to a script shortcut split this path before passing the splitted strings as multiple parameters. Here's my detailed Issue Report : Steps to reproduce ------------------ 1 - Get any script, for example : [samplescript.psd1] :  param([string]$path)
Write-Host($path) pause  or a simpler one-line sample: Write-Host($args);pause

2 - Create a shortcut that runs the script :
[Shortcut Target ] : PowerShell "path\to\our\samplescript.psd1"

3- Drag and drop a file containing spaces in its name to the shortcut
[sample file ] : C:\Some file with spaces.txt

Expected behavior
-----------------

Drag and dropping the file should pass its…

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

We’ll send you updates on this idea

• ## PowerShell Classes should allow properties with get and set

PowerShell classes should more closely mirror the abilities of a C# class imported and allow full differentiation between fields and properties. Properties should allow getter and setter code blocks

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

We’ll send you updates on this idea

• ## [BUG] Cannot import both PSDesiredStateConfiguration in-box module and PSDscResources (gallery module) in the same configuration

OS: Windows Server 2016 1607 (14393.1593)
PSVersionTable:
Name Value
---- -----
PSVersion 5.1.14393.1532
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.1532
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

PSDscResource module: v2.8.0.0

Take a look at this configuration:
Configuration DependentConfig
{
Import-DscResource -ModuleName PSDscResources -Name Registry

Node MyNode01
{

File SetupScript
{
DestinationPath = 'C:\Scripts\hello.txt'
Contents = 'somecommand'
Type = 'File'
Ensure = 'Present'
DependsOn = '[Registry]regCheck'
}

Registry regCheck
{
Key = 'HKEY_LOCAL_MACHINE\SYSTEM\SomeKey'
ValueName = 'SomeValue'
ValueData = 0
ValueType = 'DWord'
Ensure = 'Present'
}
}
}

DependentConfig -OutputPath C:\DependentConfig

This requires PSDscResources module version 2.8.0.0 from…

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

We’ll send you updates on this idea

• ## Double DependsOn in mof when using foreach loops

When using a foreach loop to create a set of resources and trying to set the previous item key as the dependsOn resource, it adds it twice in the mof file.

Configuration example:
configuration Test-DependsOnWithLoop {
param([string[]]$Directories) Import-DscResource -ModuleName PSDesiredStateConfiguration node localhost {$dependsOn = $null$dirs.ForEach({
$res =$_ -replace '\\|:', '_'
File $res { Ensure = 'Present' DestinationPath =$_
DependsOn = $dependsOn Type = 'Directory' }$dependsOn = "[File]$res" }) } }$dirs = 1..10 | % { "C:\Temp\_$_" } Test-DependsOnWithLoop -Directories$dirs

And if you look at the localhost.mof you'll see:
DependsOn = { "[File]C__Temp__1", "[File]C__Temp__1"};

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

We’ll send you updates on this idea

• ## Powershell ISE crashes when saving an ini file (I tried config.ini)

I created a new file, saved as config.ini, and then ISE crashed. When I reopened, it crashed again.

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

We’ll send you updates on this idea

• ## powershell_ise has stopped working

Problem Description:
I installed KB3134760 update in Server 2008. The powershell_ise has stopped working. Does anyone have the same problem?
Thanks

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

We’ll send you updates on this idea

• ## Bug in New-FileCatalog

This bug also applies to Test-FileCatalog, I believe.

Create a script containing the following commands, and run it with the -Verbose switch

----------------------------------------------------------

[CmdletBinding()]

param ( $path = 'SOMEPATHOROTHER' New-FileCatalog -Path$path -CatalogFilePath C:\Source.cat -CatalogVersion 2.0
New-FileCatalog -Path $path -CatalogFilePath C:\Destination.cat -CatalogVersion 2.0 ---------------------------------------------------------- The output will contain VERBOSE output, even though the script does not contain any Write-Verbose commands. 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 • ## Can you add some stuff to Get-ClipBoard? I would have liked the default behaviour to be that an array of newline-split strings was returned from Get-ClipBoard. 97 % of the time I end up writing (Get-ClipBoard) -split "\r?\n" | ...... often filtering out empty elements - and that's just boring. In my own version I used -Raw for a string and nothing for an array/list. Of course you can't change that now in the 5.x version (or later, sigh, will this be our doom in some distant future), but can you maybe add at least -AsArray or similar? Make it so it can only be used with… 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 • ## Pure Pain: Preinstalled PS Modules - Please Rationalize Them with Package Management Installs I am trying to update Pester on Windows 2016 to 4.x because the preshipped Pester 3.4.0 emits a note about the depreciation of the -quiet switch when I use the quiet switch. This get's scooped into stdout when executing via AWS SSM remote commands. Version 3.x complains it does not understand "-Show None". I want to update to 4.x - in which I ran into all the problems documented here: https://github.com/OneGet/oneget/issues/215 But ended up with "Install-module pester -force -SkipPublisherCheck. So far so bad, but when I go to remove the 3.4.0 version (with admin rights) from: 'c:\program files\windowspowershell\modules\pester\3.4.0' I get… 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 The issues you have encountered can be frustrating, sorry that is the case for you. Moving this to Survey to try to gauge the scope of the problem for users generally. We are somewhat limited by security requirements: what ships with Windows will always be tagged so that nothing can replace it easily unless it is signed by Microsoft. While Pester is part of Windows, it is not owned or developed by Microsoft, so updates delivered via the Gallery cannot be Microsoft signed. Once the Gallery version is installed on a system, -SkipPublisherCheck is no longer required for future updates. That first experience, however, is bad. This leaves us with a dilemma: do we stop shipping Pester in with PowerShell in the future, or do we continue to provide the feature set knowing users who update from the Gallery will encounter these issues? Looking for feedback from as many users… • ## Bug: Powershell ISE recovered to wrong integrity level in two sessions A crashed powershell ISE session will re-open previously open files. There is a bug, though, which manifested when a crash recovery happened to me recently: The session/file which I had originally opened in standard user context (no elevation) recovered in High integrity level (aka elevated/admin), The session/files which I had originally opened in elevated mode recovered in Medium integrity level (aka standard user mode). The session should remember which context it was open in and re-open in the same context. Need to consider this issue for normal ISE closure/re-opening, too, as in this UserVoice item: "Windows PowerShell ISE: Add ability… 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 comparing identical DSC resources with complex properties I have system modules that are deployed in nodes according to the configuration data file (psd1). For example, one node can have three modules, or there may be three nodes each one with a module. All modules have a common configuration, so I put this configuration in a separate composite resource. Then, if there are more than one module in a node, the resulting configuration will have duplicate resources. The problem occur when one of these duplicate resources have some complex property. Here is a simplified version of my configuration: Configuration BaseWebConfiguration { Import-DscResource -ModuleName xWebAdministration xWebsite DefaultSite { Ensure… 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 • ## Change validation error wording when using [ValidateCount()] When I run a simple function, like the following, I get an error, as expected that I've exceeded the number of values I can specify for the function parameter(-ComputerName). The wording says that I need to "Provide fewer than 3 arguments...". Because I can specify up to 3 arguments, I think the wording needs to change to say something like "Provide no more than 3 arguments,..." or "Provide 3 arguments, or less,...". Function Get-OSInfo { [CmdletBinding()] Param ( [ValidateCount(1,3)] [string[]]$ComputerName
)
Get-WmiObject -Class Win32_OperatingSystem -ComputerName $ComputerName } Get-OSInfo -ComputerName 'one','two','three','four' Get-OSInfo : Cannot validate argument on parameter 'ComputerName'. The… 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 .NET date formatting bug in .ToString() PS D:\> gcim win32_operatingsystem | % caption Microsoft Windows Server 2016 Standard PS D:\>$PSVersionTable.PSVersion

Major Minor Build Revision
----- ----- ----- --------
5 1 14393 1358

PS D:\> [DateTime]::Now.ToString('yyyy-MM-dd HH:mm:ss')
2017-07-27 12.29.37

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

We’ll send you updates on this idea

• ## ordered class

Cannot declare [ordered] fields/properties in script classes

The following fails to work as expected, in multiple ways:

Class Foo { [ordered] $myfield } When executing directly from an interactive shell, the output is: An error occurred while creating the pipeline. + CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : RuntimeException When executed from a script via ". .\myscript.ps1" the error is: Value cannot be null. Parameter name: type At line:1 char:1 + . .\myscript.ps1 + ~~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (:) [], ArgumentNullException + FullyQualifiedErrorId : System.ArgumentNullException What I find especially interesting is that it 'line:1 char:1' regardless of… 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 • ## When is Powershell v6 due to be released? When is Powershell v6 due to be released Will it work with Windows 10? 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 • ## Out-GridView should not leave a trailing tab character when ctrl+c is used with only one data row present. I wrote a script that takes a MAC address in any common format as input and outputs it to all other standard MAC formats. This is all in a single row of data and is meant to be a convenient tool for working between systems that use different formats of MACs without having to constantly reformat them by hand. However, when copying the output from the gridview a trailing tab is placed at the end of the MAC even though there is only a single row in the view and no tabs in the original text. It's like it is… 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: GetMetaConfiguration should validate property values against allowed values of MSFT_DSCMetaConfiguration CIM Properties Once a node meta configuration is enacted, it is easy for an administrator or process (with malicious intent) to modify the MetaConfig.mof file in C:\Windows\System32\Configuration directory. The GetMetaConfiguration method in MSFT_DscMetaConfiguration class does not validate the property values against the allowed values of the CIM properties. Steps to reproduce this behavior: - Enact a simple meta configuration and enact it. - Open the MetaConfig.MOF file in your favorite editor and change the value of ConfigurationMode to some random text. - Save the file and close it. - Run Get-DscLocalConfigurationManager. - You will see the random value assigned to ConfigurationMode in… 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 Ravikanth, We have validated this issue and created two bugs for it. 1. We will validate the MOF when it is passed in as part of our API (i.e. Set-DscLocalConfigurationManager) and error if the values are not valid. 2. We will write a warning when Get-DscLocalConfigurationManager reads a MOF that has invalid values and at LCM startup. The resultant behavior will behave like it does today where invalid values will be read as the default value by the LCM. Please let us know if this meets your expectations. Regards, MarkG • ## ISE Vi editmode Please make sure that the option: Set-PSReadlineOption -EditMode Vi works as expected in ISE as it does in the powershell.exe so we have a consistent working environment. 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- and Remove-DnsServerResourceRecord deficiencies Get- and Remove-DnsServerResourceRecord have a couple of deficiencies: 1) most cmdlets support piping from Get-* to Remove-*, this does not currently work properly with Remove-DnsServerResourceRecord... "The input object cannot be bound because it did not contain the information required to bind all mandatory parameters: ZoneName" So, the objects returned from Get-DnsServerResourceRecord should contain the ZoneName property. 2) Remove-DnsServerResourceRecord does not respect -Confirm:$false, even when it's specified, it asks for confirmation every time.

i.e. this will ask for confirmation 200 times if you have 200 records (and -ZoneName must be specified because of the aforementioned issue!), at least thankfully you can…

1 vote
Check!
(thinking…)
Reset