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. |
-
Install a program remotely via RunAs
With this code, I want to install a program via cmd in administrative mode, but it doesn't work
$RemoteMachine = "10.1.1.40"
$Username = 'user'
$Password = ' '
$pass = ConvertTo-SecureString -AsPlainText $Password -Force
$Cred = New-Object System.Management.Automation.PSCredential -ArgumentList $Username,$passInvoke-Command -ComputerName $RemoteMachine -Credential $Cred -ScriptBlock { Start-Process -FilePath "c:\install.bat" -Verb RunAs }
1 vote -
1 vote
-
Allow IF statements to be enclosed in () without using a variable.
Can someone explain why IF statements fails when enclosed in () without a variable? See example below:
$x = 5
$y = 6Fails
( if ($x -eq $y) { "Match" } ELSE { "No Match" } )
Works
if ($x -eq $y) { "Match" } ELSE { "No Match" }
( $xy = if ($x -eq $y) { "Match" } ELSE { "No Match" } )Returned Error
if : The term 'if' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was…
1 vote -
Invoke-Command for ComputerName localhost starts to fail after a scheduled job is run
Typically I can run invoke-command against localhost without requiring any credentials. For example, this works:
Invoke-Command -ComputerName localhost -ScriptBlock { return $null }
However, if you then use the same system to run a scheduled job, for example:
Register-ScheduledJob -ScriptBlock { write-host "hi" } -RunNow
You will see that afterwards the former Invoke-Command will now fail with access denied and requires credentials to be passed in order to succeed.
Basically the behavior of Invoke-Command and localhost remoting is CHANGED when you execute Register-ScheduledJob with -RunNow. This is not expected or documented.
1 vote -
Bug: When defined in an expression, defining a class with references to two other classes throws "Could Not Load Type"
When importing a module that uses expressions to define custom powershell classes, if a class definition references two or more previously defined, custom powershell classes, PowerShell runtime throws an "Could not load type" exception.
Version: PowerShell 5.1, Windows 10
Code to reproduce:
The below code can either be put into into a module file or run directly in a powershell window:Invoke-Expression @'
enum EnumOne {
One = 1
Two = 2
Three = 3
Four = 4
}
'@Invoke-Expression @'
class ClassOne {
[string]$Property1ClassOne([string]$prop1) {
$this.Property1 = $prop1
}
}
'@Invoke-Expression @'
class ClassTwo {
[ClassOne]$ClassOne …1 vote -
JEA -user should not be able to bypass cmdlet restrictions
Presently, if JEA is enabled on target server with cmdlet restrictions for a user account 'user1' - then if the user1 sends command construct with below structure then irrespective of cmdlet restrictions - user1 is able to obtain administrative privelege. This should be fixed as anyone can misuse the JEA features.
1 vote -
Windows PowerShell 5.1 hangs displaying result from Invoke-WebRequest
Entering this reproducibly hangs Windows PowerShell 5.1:
$r = iwr 'https://marketplace.visualstudio.com/items?itemName=austin.code-gnu-global'
$rHere's what one gets with Set-PSDebug -Trace 2:
> $r
DEBUG: 94+ >>>> {
DEBUG: ! CALL function '<ScriptBlock><DynamicParam>'
DEBUG: 97+ >>>> $getCommand = $executionContext.InvokeCommand.GetCmdlet(
DEBUG: ! SET $getCommand = 'Get-Command'.
DEBUG: 99+ >>>> $foreachObject = $executionContext.InvokeCommand.GetCmdlet(
DEBUG: ! SET $foreachObject = 'ForEach-Object'.
DEBUG: 101+ >>>> $whereObject = $executionContext.InvokeCommand.GetCmdlet(
DEBUG: ! SET $whereObject = 'Where-Object'.
DEBUG: 107+ >>>> $command = & $getCommand Out-Default -Type Cmdlet
DEBUG: ! SET $command = 'Out-Default'.
DEBUG: 108+ >>>> $targetParameters = @{}
DEBUG: ! SET $targetParameters = 'System.Collections.Hashtable'.
DEBUG: 109+ >>>>…2 votes -
PowerShell 5.1 can mix two encodings, like Unicode and utf8, in the same file.
This happens when you using "Get-Content" for a file written by PowerShell with "Out-File", and also when PowerShell_ISE prints variables obtained from other applications with "IBM037" encoding, PowerShell prints the result to the Console and mixes both UTF-8 and Unicode characters.
Which makes it impossible to filter a result properly. (This can be seen by printing the result out by Out-GridView )
1 vote -
Start-sleep progress bar
We require a progress bar to track the time is left till the Pause ends.
1 vote -
Windows file shortcuts
Powershell should be able to create windows shortcuts natively. .lnk
1 vote -
BUG Using Where-Object? PowerShell 4.0 and 5.1 OK in 2.0
I really think there is a bug in Where-Object with $_.LastAccessTime
It always returns Last Write Time, NOT Last Access Time. However, Select-Object works..Sample -
Get-ChildItem -Recurse -Path c:\ | Where-Object {$_.LastAccessTime -le (Get-Date).AddDays(1)}Result -
Mode LastWriteTime Length Name
...list of files...
I have tested with PowerShell 2.0 (Windows 2008 R2) 4.0 (Windows 2012 R2) and 5.1 (Windows 2016 and Windows 10).
It WORKS as expected on Powershell 2.0
However, this sample works, but I am unable to finger out how to do anything (like Remove-Item) with the results.
< save the below as a .ps1 file and…
1 vote -
Powershell command subommand parameters interactive list with ? button
A function like cisco devices that show a list of powershell parameters with the ? button:
Example:
Restart-Computer -c?-computername
-credential
-others1 vote -
Powershell "Get-ChildItem -Recurse" does not work on Windows Server 2019
Win Server 2019 (Azure VM)
For non-exist dir, powershell print a Windows Defender path.
Something interesting:
It's fine without "-Recurse" (see the 2nd command in above screenshot)
It's limited to certain path. C:\non-exist-dir cause different output from C:\Program Files\non-exist-dir while D:\non-exist-dir is fine.
- There's no issue with existing dir.
I guess somehow Windows Defender kicks in during powershell execution and did some strange relocation?
Here's the full log in text form:
PS C:> Get-ChildItem "${Env:ProgramFiles}/non-exist-dir" -Recurse
Get-ChildItem : Access to the path 'C:\Program Files\Windows Defender Advanced Threat Protection\Classification\Configuration' is denied.
At line:1 char:1
+ Get-ChildItem "${Env:ProgramFiles}/non-exist-dir" -Recurse
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
…+
1 vote -
cannot run additional paramaters
Powershell can't seem to run append document files to a command
using firebase emulators you are required to usefirbase functions:config:get > .runtimeconfig.json
this does not work in powershell, only in the raw windows cmdlet
Reference: https://firebase.google.com/docs/functions/local-emulator#setupfunctionsconfigurationoptional1 vote -
Put CloudShell on Office 365
Put this directly into the Office 365 Admin console if you are forcing us to use something that never works unless you've become a professional with it AND get all the updates on all the changes that happen in just a single month, so put it directly in Office 365 just like Azure has and YOU keep it updated with the right libraries and modules and all that so when we need to run a command, we don't have to search for 45 minutes to get it going, or when you need to run tech support, you know the platform…
1 vote -
Provide feedback during typing of password
I just typed my password into a chatroom because although it looked like the PowerShell window had focus, I was entering a password where there is zero feedback. If I had seen a placeholder appear per character like text boxes on websites, I would have been able to tell that the text I was typing was not going to the right window.
When typing into a password field, I would like to see feedback with something like ******, each * representing a character I typed.
This is something you can enable with other shells like in this article about Linux,…
1 vote -
Powershell command to show which versions of SSL/TLS enabled and disabled
Since server 2016 has tls 1.0 -1.2 enabled by default but no corresponding registry keys, admins always feel a little in the dark about whether they are truyl enabled or not, and have to go look it up. It would be great to have a powershell command that showed which versions of TLS or SSL are enabled/disabled, instead of having to use sketchy 3rd party solutions.
1 vote -
Disable or Restrict Powershell -EncodedCommand
Powershell is targeted more often as a vector for breaching computer systems. Script signing prevents malicious use of scripted payloads, but an encoded command allows for complex command sequences to be executed in an obfuscated manner, outside of behavior based detection mechanism. Security Groups are calling for disabling of Powershell altogether because there are not security controls to lock down specific features. Disabling Encodedcommand for standard users would at least be a start to breaking the methodologies of those seeking to breach security by leveraging command and control utilities.
2 votes -
Get-Content with cast to [xml] doesn't properly detect encoding of input file
Get-Content with cast to [xml] doesn't properly detect encoding of input file
[xml]$xml = Get-Content $sample
where sample is an UTF-8 file and $xml is in CP-1251
The expectation is to have encoding detected automatically like it happend in XmlDocument.Load method
https://docs.microsoft.com/en-us/dotnet/api/system.xml.xmldocument.load?view=netframework-4.8Please check attached script with the example of the bug.
1 vote -
Get-Content with cast to [xml] doesn't properly detect encoding of input file
Get-Content with cast to [xml] doesn't properly detect encoding of input file
[xml]$xml = Get-Content $sample
where sample is an UTF-8 file and $xml is in CP-1251
The expectation is to have encoding detected automatically like it happend in XmlDocument.Load method
https://docs.microsoft.com/en-us/dotnet/api/system.xml.xmldocument.load?view=netframework-4.8Please check attached script with the example of the bug.
1 vote
- Don't see your idea?