Forum Discussion
Feb 09, 2024
Get-StartApps : The term 'Get-StartApps' is not recognized as the name of a cmdlet, function, script
I have a command such as
(Get-StartApps | Where-Object name -eq 'Notepad').AppId
or just simply
Get-StartApps
which works just fine via PowerShell ISE.
I, on the other h...
- Feb 11, 2024
The only suggestion I have now is replacing your "powershell.exe" statement with a full path alternative of:
C:\Windows\SysNative\WindowsPowerShell\v1.0\powershell.exe
Cheers,
Lain
Feb 11, 2024
Yes, I'm running Office x86 on Windows 10 x64
LainRobertson
Feb 11, 2024Silver Contributor
The only suggestion I have now is replacing your "powershell.exe" statement with a full path alternative of:
C:\Windows\SysNative\WindowsPowerShell\v1.0\powershell.exe
Cheers,
Lain
- LainRobertsonFeb 17, 2024Silver Contributor
Fair enough, though it means your functions will only work on 32-bit Office, since the virtual alias of sysnative only exists for 32-bit processes running on 64-bit Windows (with syswow64 being the alias in the opposite direction of 64-bit process requiring a 32-bit Windows resource).
Cheers,
Lain
- Feb 17, 2024Thanks for all your help!
sysnative is the solution. I'm not checking if the OS is 64-bit and then using sysnative is required.. - LainRobertsonFeb 11, 2024Silver Contributor
Above my pay grade again (on the why), but here's some doco on it:
On the how, it's a process-level translation, not a physical construct.
Still, as long as you're working, you're good. And you've got a new trick to leverage should this kind of occurrence arise again.
Cheers,
Lain
- Feb 11, 2024
Just got that working.
c:\windows\sysnative\WindowsPowerShell\v1.0\powershell.exe
does launch PS x64.
But why????
C:\Windows\sysnative\WindowsPowerShell\v1.0\powershell.exe does not exist.
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe exists and tried that but it still launches PS x32
Where does SysNative come from???? I found it in a discussion, but why wouldn't the real path 'System32' work?Why does MS do screwy things like this! If I give the path to the exe I want t you, why would MS override that!