systeminfo | c:windowssystem32find.exe "System Type"
System Type: x64-based PC
both in a Command Prompt window and in PowerShell.
Now suppose I want to make it independent from where the system resides (say, if I want to include this command in some guide for careless users or alike). I thought about invoking instead
systeminfo | %SystemRoot%system32find.exe "System Type"
This works in a Command Prompt but not in PowerShell. In the latter, I have tried
systeminfo | $env:SystemRootsystem32find.exe "System Type"
but this gives the error
Expressions are only allowed as the first element of a pipeline.
I also tried
systeminfo | % $env:SystemRootsystem32find.exe "System Type"
but this produces an avalanche of errors like
% : Input name "C:WINDOWSsystem32find.exe" cannot be resolved to a method.
What is going on? How to do it properly?