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. |
-
25 votes
Would be interested in understanding the scenario where you are using the cmdlet & specifying the reason for rebooting. To explain: our previous assumption was that users would EITHER use the server UI that captured this information, OR use the cmdlet (often so they didn’t need to supply that reason text).
So, what would help is to understand in what situations the cmdlet is being used and specifying the reboot explanation is desirable. -
Add a PowerShell module to manage Windows Updates
Add a PowerShell module to manage Windows Updates like you can now with the GUI. Like checking for updates, installing all updates, or a selection of updates, creating a report of pending updates, etc. The Windows Update options in the Server Configuration Manager (sconfig) are very limited.
47 votesWe don’t own the creation of modules for operating system features. I’ll mark this as Survey so we can provide this information to the WU team, but you might also want to consider filing this in the Windows 10 Feedback Hub. Also, see the community-created PSWindowsUpdate link below :)
-
Get-WinEvent - FilterHashtable - query is wrong
I do test:
$a=Get-WinEvent -FilterHashtable @{LogName="Microsoft-Windows-PrintService/Operational";"Param5"=
"UserPrinterName"} -Verbose -ComputerName printserverVERBOSE: Constructed structured query:
<QueryList><Query Id="0" Path="microsoft-windows-printservice/operational"><Select
Path="microsoft-windows-printservice/operational">[([EventData[Data[@Name='Param5']='UserPrinterName']] or
[UserData//Param5='UserPrinterName'])]</Select></Query></QueryList>.Get-WinEvent : No events were found that match the specified selection criteria.
- Really the log contain events under the filter!
- If you copy-paste the Constructed structured query into Eventvwr.msc then you get error!
- If I do the test with part of the generated query "[UserData//DocumentPrinted/Param5='UserPrinterName']" then you get the events in Powershell and in Eventvwr.msc
1 voteIt looks like you found the issue and have a fix. Right now the easiest+ quickest way to get this fixed would be to go through GitHub. Please update this issue if you do go down that path and I will mark this as external.
-
Get-Date -UFormat %V is incorrect
Get-Date -UFormat %V is supposed to return the ISO 6801 week number like Unix does. I don't understand what value it currently returns (I think it's nothing sensible), but it definitely is NOT the correct week number!
5 votes -
-IgnoreCertificateCheck or -SkipSslVerification parameter for [Invoke-WebRequest & Invoke-RestMethod]
Invoke-WebRequest & Invoke-RestMethod need a parameter to easily skip/ignore checking for a valid certificate of https uri's. This could be required for a number of reasons such as development site only using self signed certificate while testing.
10 votes -
Invoke-WebRequest returned object hangs when accessing Links property
OS: Windows 7 - 10
Name : ConsoleHost
Version : 5.0.10586.117
InstanceId : 078d4e23-84fd-433c-a831-37bb0935166e
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : en-US
CurrentUICulture : en-US
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled : True
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace
Not working example:
$releases = 'https://github.com/hluk/CopyQ/releases'
$downloadpage = Invoke-WebRequest -Uri $releases -UseBasicParsing
$downloadpage.links # <-- hangs hereOther properties seem to work normally.
This example uses basic parsing and works without out. However, the behavior doesn't generally depend on this setting and I had sites that hang on many occasions.
The following issues seems related:
https://windowsserver.uservoice.com/forums/301869-powershell/suggestions/11088744-invoke-webrequest-hangs-in-some-cases-unless-use
https://windowsserver.uservoice.com/forums/301869-powershell/suggestions/11515881-invoke-webrequest-hangs-freeze-at-many-websites11 votes -
BUG: new-localuser fails to allow connection to Microsoft account
The New-LocalUser cmdlet available in Windows 10 Anniversary Update cannot perform a function described in the documentation.
Local user accounts may be connected with existing Microsoft accounts. New-LocalUser should support this by accepting a -Name parameter of the form "MicrosoftAccount<user>@outlook.com". This is described in the detailed help.
However this fails because the parameter fails validation as it is over 20 characters in length (already true with "MicrosoftAccount" and "@outlook.com" let alone the "actual" user name). The 20 character limit is valid for a regular local account name, but shouldn't be valid for an MS account name.
There appears no other…
12 votes -
Add a Duration column to the History output
The output of Get-History has Start and End times which can be put together to calculate a Duration. Why not add that to the default formatting of history objects?
As a workaround, I use these:
https://gist.github.com/Jaykul/2d4dc5e4f5195c726368435055b8acdb5 votes -
BUG: ScheduledTaskTrigger -RandomDelay does not work
New-ScheduledTaskTrigger -AtLogOn -RandomDelay 0:15:00; or
New-ScheduledTaskTrigger -AtLogOn -RandomDelay (new-Timespan -Minutes 15)
does not set the delay option. The checkbox in ScheduledTask Panel never gets set.
Windows 10.0.14393 x64 de-DE (German Installation)6 votes -
Allow using Select, Sort, Group, and Measure without a pipeple
It should be possible to use Select-Object, Sort-Object, Group-Object, and Measure-Object without a pipeline.
In those circumstances where a script needs to be optimized for speed, one of the first things to do is to eliminate pipelines because of the huge overhead they incur. Because of these four commands, eliminating all pipelines is sometimes impossible or requires coming up with complex alternatives to them.
I would expect these two commands (or some variation of the second one) to produce the same result:
2, 1, 3 | Sort-Object
Sort-Object -InputObject 2, 1, 3Currently, the second line treats the array in…
3 votes -
Get-ComputerInfo most properties are empty
I try the new CMDLet Get-ComputerInfo, but the most properties in the result are empty.
Only this properties show values:
WindowsBuildLabEx,WindowsCurrentVersion,WindowsEditionId,WindowsInstallationType,WindowsInstallDateFromRegistry,WindowsProductId,WindowsProductName,WindowsRegisteredOrganization,WindowsRegisteredOwner,WindowsSystemRoot,TimeZone,LogonServer,PowerPlatformRole,DeviceGuardSmartStatusTry also as Admin and with different Hardware and VM's. (Windows 10 x64 Versiom 1607)
Beste regards
brima7 votes -
"Select-Object -Unique" and "Group-Object" should not have quadratic runtime
De-duplicating a collection, or aggregating similar items in a collection, can be done in linear time via hash sets or hash tables, respectively.
"Select-Object -unique" and "Group-Object", however, both use O(n^2) algorithms that rely only on equality, never leveraging hashing. It's literally faster (by a lot) to use "Sort-Object -Unique", which additionally does sorting.
Blog post at http://latkin.org/blog/2016/08/02/curious-behavior-when-de-duplicating-a-collection-in-powershell/ has more explanation.
It was suggested by Bruce P on Twitter that I open this bug: https://twitter.com/BrucePayette/status/760532657293832192
2 votes -
WMF5.1 - Get-ComputerInfo unable to find entry point GetFirmwareType
Running the new Get-ComputerInfo returns the following error
C:> Get-ComputerInfo
Get-ComputerInfo : Unable to find an entry point named 'GetFirmwareType' in DLL 'kernel32.dll'.This is on a XenDesktop VM hosted on VMWare, so I guess it's due to the desktop being virtualised. OS is Win7x64
14 votes -
Tee-Object doesn't work in scripts/functions that support ShouldProcess
Overview
When Tee-Object is used in a function/script that supports ShouldProcess, it doesn't work. It appears that internally, Tee-Object uses Set-Variable, which does support ShouldProcess. Tee-Object itself doesn't support ShouldProcess, so you can't change the behavior with a -WhatIf:$false parameter.
Steps to Reproduce
function Invoke-TeeObject
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
)Get-ChildItem -Path $env:temp *.fubar | Tee-Object -Variable 'tempFilesFound' | Remove-Item -Recurse -Force
Write-Output ('Removed {0} temporary text files.' -f $tempFilesFound.Count)
}'' | Set-Content -Path (Join-Path -Path $env:Temp -ChildPath 'tee-object.fubar')
Invoke-TeeObject -WhatIfResults in this output:
…What if: Performing the operation "Remove File" on target "C:\Users\ajensen\AppData\Local\Temp\tee-object.fubar".
What if: Performing the operation2 votes -
Add eval alias to Invoke-Expression to PowerShell core
Adding an eval alias to the PowerShell core, pointing to the Invoke-Expression command, would help to improve compatibility with Bash scripts on Linux.
2 votes -
Add support for TLS 1.2 (Invoke-WebRequest, Invoke-RestMethod)
Invoke-WebRequest and Invoke-RestMethod commands only support TLS 1.0 protocol. We need to have a native support for newer TLS (1.2) versions for modern web interfaces.
50 voteschanging to Survey based on Joonas’ comment below – request is to have a flag to force TLS 1.2.
-
ConvertTo-Json doesn't serialize simple objects properly
Given a simple array which has been boxed in a PSObject
[PSObject]$o = @(@(Foo,1),@(Bar,2))
Calling ConvertTo-Json returns a weird pointless wrapper around it:
convertto-json $o
{"value": [
[
"Foo",
1
],
[
"Bar",
2
]
],
"Count": 2}
Which completely breaks round-trip support
ConvertFrom-Json (Convertto-Json $o)
value Count
{Foo 1, Bar 2} 2
16 votes -
ConvertFrom-Csv has undocumented partial comment support
When multiple strings are fed into ConvertFrom-Csv, it will ignore lines prefixed with a '#' character. When fed a single string, it retains those lines. Unless it is the first line, in which case it is ignored either way. This behavior happens whether sent through the pipeline or provided to the -InputObject parameter.
The workaround is to use double quotes around the item with the leading '#'.
I guess this comes from handling the optional type information. The check for the "#TYPE" seems to happen only once with the single string, and every time when given multiple strings.
Choose either…
3 votes -
Improve the speed of Get-EventLog
As you describe here:
https://blogs.technet.microsoft.com/heyscriptingguy/2011/03/08/how-to-improve-the-performance-of-a-powershell-event-log-query/
The Get-EventLog command is slow. Using Get-WinEvent is much faster.The Get-EventLog is still easier to use though.
Maybe Get-EventLog could be refactored to use Get-WinEvent6 votes -
New Cmdlet(s) for AG Lease Events
MSSQL Tiger Team gave a great presentation today about new extended events and properties for troubleshooting AoAG. These improvements rely on AG Lease & X-events. It would be great to have a set of Cmdlets added to the AG modules to return information captured by AG-Lease a few examples:
Get-AGDiagnosticEvent
Get-AGLeaseExpired
Get-AGLeaseSystemComponent1 voteWe will forward the request, but this is really something you want to send to the SQL Server team. They develop the PowerShell cmdlets for SQL. I would recommend that you send this request to the people who gave the presentation, as feedback from the presentation.
- Don't see your idea?