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. |
-
Bug with System.IO.FileInfo arrays
When trying to join arrays of FileInfo objects, if the first array contains only one element, the following error occurs.
Method invocation failed because [System.IO.FileInfo] does not contain a method named 'op_Addition'.
At line:1 char:1
+ $stuff + $stuff1
+ ~~~~~~~~~~~~~~~~+ CategoryInfo : InvalidOperation: (op_Addition:String) [], RuntimeException
+ FullyQualifiedErrorId : MethodNotFoundIt works as expected as long as the first array contains more than 1 element. See example below:
PS C:\Scripts> $stuff
Directory: C:\Scripts
Mode LastWriteTime Length Name
-a---- 10/3/2016 2:01 PM 58 LaunchUpdateAllSubversionWorkingCopies.bat
PS C:\Scripts> $stuff1
Directory: C:\Scripts
Mode LastWriteTime Length Name
-a---- 10/26/2016 1:19 PM 140 DropConnections.sql …
1 voteThanks @mhu for offering the solution here.
As an aside, Get-ChildItem returns a collection of 1 when there’s only one item specifically to avoid this problem.
-
Update-Help: Failed to update Help for the module(s) 'NetworkControllerDiagnostics'
The following error show up when executing 'Update-Help -force':
PS C:\WINDOWS\system32> Update-Help -Force
Update-Help : Failed to update Help for the module(s) 'NetworkControllerDiagnostics, Provisioning' with UI culture(s)
{en-US} : Unable to retrieve the HelpInfo XML file for UI culture en-US. Make sure the HelpInfoUri property in the
module manifest is valid or check your network connection and then try the command again.
At line:1 char:1
+ Update-Help -Force
+ ~~~~~~~~~~~~~~~~~~+ CategoryInfo : ResourceUnavailable: (:) [Update-Help], Exception
+ FullyQualifiedErrorId : UnableToRetrieveHelpInfoXml,Microsoft.PowerShell.Commands.UpdateHelpCommandPS C:\WINDOWS\system32> $PSVersionTable
Name Value
PSVersion 5.1.15048.0
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.15048.0
CLRVersion 4.0.30319.42000
WSManStackVersion…1 voteI believe this has been fixed, give a holler if it still shows up for you.
-
Bug: Get-DscConfigurationStatus doesn't show all resources/configurations
We started to use results from Get-DscConfigurationStatus in our monitoring (SCOM) and while analyzing the results we noticed that some partials are not showing up in the results of this command even though tests/set/get is performed on the target node. After analyzing different methods we found out that:
- MOF documents generated in C:\Windows\System32\Configuration\ConfigurationStatus seem to limit the results to ~40 last items in DSC configuration
- Get-DscConfigurationStatus and Test-DscConfiguration -Detail all use the same source of information, thus provide same, truncated output
- The only reliable source of information is details.json file generate when -Verbose output is requested, but information there is…
6 votesFixed in 5.1
-
MSFT_WebDownloadManager issue
Hi there,
Please advise on the following failure I am facing while trying to apply DSC changes on the remote machine:
"
PS C:\Windows\system32> Set-DscLocalConfigurationManager -Path .\LCMPullMode
Undefined class: MSFT_WebDownloadManager
At line:15, char:2
Buffer:
Connection = True;
};^
ins+ CategoryInfo : SyntaxError: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : MiClientApiError_Failed
+ PSComputerName : be-lab-v17"
Thanks in advance,
Ofer1 vote -
Multi Line description passes Test-ScriptFileInfo but fails to publish
When I tried to publish the script https://raw.githubusercontent.com/SQLDBAWithABeard/DataScienceVM/master/New-WindowsDataScienceVM.ps1 it fails with missing description but passed the Test-FileScriptInfo prior to me trying
1 vote -
powershell.exe -Command - is broken on Windows 10 14393
I wrote a post that includes the source for a tiny C# program that demonstrates that trying to launch powershell.exe with its "-Command -" parameter to get the script from StdIn no longer works after installing the Anniversary Update on Windows 10. Does not happen on Server 2016 TP5. I can duplicate the details here if that makes more sense.
34 votesThe fix for this issue has been backported from 6.0-alpha to 5.1 in the latest fully patched Win10 Anniversary Update. This repro should show powershell.exe -Command with -RedirectStandardInput working, and also demonstrates the version of PowerShell you should be on.
C:\temp> set-content .\in.txt ‘$psversiontable’ -Encoding ascii
>> Start-Process -FilePath ‘powershell.exe’ -ArgumentList “-Command -” -RedirectStandardOutput "out.txt
" -RedirectStandardInput “in.txt”
C:\temp> cat .\out.txtName Value
---—
PSVersion 5.1.14393.206
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
BuildVersion 10.0.14393.206
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1Note: if your problems aren’t fixed, and you’re on this version of PowerShell 5.1 or greater, please file another issue here on UserVoice to address it.
Thanks!
Joey -
Core help files (as of 2016-11-08) have broken text formatting
Helpfiles for most about topics (with random exceptions), when updated (and file name corrected -- see bottom), change text formatting to a strict all-lines-that-are-not-headers-get-indented-four-spaces. This makes many files look completely ugly and broken. Here is an example from aboutExecution_Policies as viewed in PowerShell help between two different versions of the file:
9-30-2016:
USE GROUP POLICY TO MANAGE EXECUTION POLICY
…------------------------------------------- You can use the "Turn on Script
Execution" Group Policy setting to manage the execution policy of computers
in your enterprise. The Group Policy setting overrides the execution
policies set in Windows PowerShell in all scopes.
The "Turn on2 votesThis should be fixed. Open PS as administrator and run update-help -force . if that does not resolve the issue, please let me know and i’ll revert the “completed” status.
-
Small typo in gci help
Hello,
there is a small typo in the help of gci for the attibute "-LiteralPath"
It says it " Specifies, as a string arrya," instead of array .I know it's a small one, but it kind of helps to make Powershell even better
Best regards
1 voteFixed in the GitHub repo (and online), when https://github.com/PowerShell/PowerShell-Docs/issues/1073 is resolved it will start flowing into get-help.
-
Write-Information should accept pipeline input
All other Write-* cmdlets accept pipeline input, which makes it possible to write, for example:
Get-Foo | Set-Bar -PassThru | Out-String | Write-Verbose
instead of the more cumbersome:
Write-Verbose (Get-Foo | Set-Bar -PassThru | Out-String)
Write-Information would be more convenient to use if it accepted pipeline input, too.
3 votesThanks to iSazonov, this has been added to the latest PowerShell Core 6.0 alpha: https://github.com/PowerShell/PowerShell/pull/2680
If you feel very strongly that this should be backported to Windows PowerShell 5.x, please open another suggestion, but I should warn you that it the bar is very high, so we would have to see a very large amount of customer demand.
Best,
Joey -
Help for -UseTransaction is broken
I've see help documentations for several cmdlets like Move-Item, Copy-Item, Set-Acl, etc. and their "-UseTransaction" help is broken it reads:
"Includes the command in the active transaction. This parameter is valid only when a transaction is in progress. For more information, see [Repetition of the same]"1 voteOk, fixed in online help. It will migrate into get-help once we get the pipeline fixed. (tracking issue: https://github.com/PowerShell/PowerShell-Docs/issues/1073 )
-
Assigning a value to `$?` (`$? = $false`) crashes powershell.exe
PowerShell crashes when I run an invalid command such as
$? = $false
. Just enter and run$? = $false
in powershell.exe or powershell_ise.exe.[[[
Test-Path "C:\test"
if ( $? = $false ) {
Out-Host "Hello World"
}
]]]I guess that PowerShell should display an error telling that I'm trying to perform an invalid action.
The problem reproduces on Windows 10 Pro and PowerShell 5.1.14393.206. The problem does not seem to reproduce with PowerShell 5.0 (5.0.10586.122).
bucket 127386360339, type 5
Event Name: PowerShell
Response: Not available
Cab Id: 0
Problem signature:
P1: powershell.exe
P2: 10.0.14393.206
P3: stem.Management.Automation.PSInvalidCast
P4:…2 votesAs Pavel posted, this got fixed in the latest alpha of PowerShell 6.0 Core: https://github.com/PowerShell/PowerShell/pull/2320
-
Fill in Win32_NetworkAdapterConfiguration CIM class on Nano
Running 'Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration' in powershell on a Nano server does not return any information. Unless they are officially deprecated, classes like this should work on Nano server.
1 voteSome underlying components needed for the Win32_NetworkAdapterConfiguration class are missing in the current release of Nano Server. This has been fixed in the upcoming (next) release of Nano Server.
-
MinimumCompatibleVersion cause "Cannot find module PSDesiredStateConfiguration_1.0 from the server"
Box
DSC PULL Server : Windows Server 2012 R2 + WMF5 RTM
DSC PULL Client : Windows Server 2012 R2 + WMF5 RTM
Description of Issue:
In WMF5.0 there is PsDscRunAsCredential to target dedicated user to make it so. However mof document created by configuration with this property, will cause "Cannot find module PSDesiredStateConfiguration_1.0 from the server http://DSCPull:8080/PSDSCPullServer.svc/Modules(ModuleName='PSDesiredStateConfiguration',ModuleVersion='1.0')/ModuleContent" exception and could not apply configuration.
Reproduce Procedure:
Note: It's no meaning with this configuration to target PsDscRunAsCredential, but please understand this is just a simple reproduce configuration
Create configuration to use WMF5 functionality, in this case PsDscRunAsCredential.
```powershell
configuration FeatureNetCore …19 votesThis issue has been fixed in WMF 5.1 and a workaround exists as noted in comments.
MarkG
-
PowerShell 5 on Windows 10/Server 2012 HelpFiles are incomplete
Get-Help -Category HelpFile does not return the full list of topics available here: https://technet.microsoft.com/en-us/library/hh847856.aspx
This issue is present on clean installs of Windows 10/Server 2012 and there does not appear to be a way of rectifying the issue (Update-Help -Force, Save-Help from other machine, Reset This PC have all been tried).
4 votesThis should be fixed. Open PS as administrator and run update-help -force . if that does not resolve the issue, please let me know and i’ll revert the “closed” status.
-
get-package error on ps 5.1
The behaviour of get-package cmdlet is different compared with 5.
get-package firefox works on 5 but no on 5.1
get-package firefox works on 5.1 but no on 5
1 voteDan’s explanation below is correct. Just closing this one out.
-
ConvertFrom-String example 5 is wrong
Example #5 for the ConvertFrom-String cmdlet is wrong.
It states that it will generate an object with default property names and with the specified property types (string and integer), but it is the same as example #4 (just the property names)1 vote -
Microsoft.PowerShell.Operation.Validation module has invalid HelpInfoUri
The HelpInfoUri of Microsoft.PowerShell.Operation.Validation module looks like a placeholder: http://go.microsoft.com/fwlink/?LinkId
Since it doesn't point to a HelpInfo XML file, updatable help is failing and there's no help for the module.
1 voteFixed for Windows Server 2016 GA. Thanks!
-
BUG: Import-PSSession no longer works since Win 10 Anniversary Update
Seems to be since Win 10 Anniversary update recently, connecting to Exchange Online gives this error:
Import-PSSession : Could not load type 'System.Management.Automation.SecuritySupport' from assembly 'System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
also reported here:
http://answers.microsoft.com/en-us/spark/eb85073b-0234-4f8d-a11d-d6a245286bae?page=34 voteshttps://blogs.msdn.microsoft.com/powershell/2016/08/23/powershell-dsc-broken-in-kb3176932/ has more information, thanks very much for the report.
-
Firewall Rules Documentation on website
Im working in an environment with strict firewall policies, I'm struggling to find any information on ports used to execute commands such as install-module...
1 voteThere are 3 basic elements for PowerShell remote access today:
1. WinRM, which is the basis for PowerShell remoting. There’s a good article here: https://blogs.technet.microsoft.com/christwe/2012/06/20/what-port-does-powershell-remoting-use/
2. HTTP/HTTPS – this is the vast majority of other remoting. Install-Module, PackageManagement, Invoke-RestMethod, etc. all go over standard internet ports, and generally default to HTTPS.
3. DCOM ports can specified for CIM-based cmdlets, but it is not the default. You can find out which modules support this option by searching for *.ps1xml in C:\Windows\System32\WindowsPowerShell\v1.0\. Again, that’s not the default.Hope this resolves the question.
-
How do I configure multiple owners of a single project or item?
My colleague and I contribute to a project and both of us own it, how can I add him as a secondary owner? It appears this isn't possible.
1 voteThere is documentation for this at https://msdn.microsoft.com/en-us/powershell/gallery/psgallery/managing-item-owners
A couple tips: The user must have already registered with the PowerShell Gallery, and you must know the PowerShell Gallery user name for the individual, not just their email address.
If they have forgotten what their user name is, have them log in. The user name will show up in the upper right-hand corner of the screen.
After that an automated email will be sent to their registered email account. If they don’t see it, have them check junk mail. Email systems regularly filter out mail coming from unknown accounts, particularly if there is a link in the mail (as will be the case for this one).Let us know if that does not answer your questions.
- Don't see your idea?