Did your command include the "$_" before before Type? I don't see it in your error message.Thanks! The first two are not executed in Powershell, error message due to “.Type”:
+ (Get-Partition -DiskNumber 0 | Where-Object { .Type -eq ‘System’ })
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (.Type:String) [Where-Object], CommandNotFoundException
[I] + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.WhereObjectCommand[/I]
This is the output of the third one:
View attachment 153667
Here's what happens when I run it on my system without and with the "$_" (note, my System disk is DIsk 1 so that's why I'm using 1 vs 0).
(WITHOUT)
powershell -ExecutionPolicy Bypass -Command "(Get-Partition -DiskNumber 1 | Where-Object { .Type -eq 'System' })"
Where-Object : The term '.Type' 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 included, verify that the path is correct and try again.
At line:1 char:32
+ (Get-Partition -DiskNumber 1 | Where-Object { .Type -eq 'System' })
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (.Type:String) [Where-Object], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.WhereObjectCommand
(WITH)
powershell -ExecutionPolicy Bypass -Command "(Get-Partition -DiskNumber 1 | Where-Object { $_.Type -eq 'System' })"
DiskPath: \\?\scsi#disk&ven_nvme&prod_samsung_ssd_990#5&29ebe5f4&0&000000#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
PartitionNumber DriveLetter Offset Size Type
--------------- ----------- ------ ---- ----
1 1048576 260 MB System
My Computer
At a glance
W11P-24H2
- OS
- W11P-24H2








