521715 (1) [Avatar] Offline
#1
Hi everyone,

I'm currently at chapter 7: Profile scripts. In 7.8 there's an example on how to make a PSConsoleFile:

Export-Console c:\myshell.psc


Next you have to make a shortcut with the following target:

%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -noexit -psconsolefile c:\myshell.psc


However, I get an error message saying: The term '-psconsolefile' is not recognized as the name of a cmdlet, function, script file, or operable program.

I'm using Windows Server 2012 and PowerShell version 5.1.14409.1012.

Is it still possible to use this option? Or did it became obsolete? The Export-Console cmdlet is still working though...I hope someone can clarify this for me. Thanks!
345661 (8) [Avatar] Offline
#2
I get the same thing using
> $PSVersionTable

Name Value
---- -----
PSVersion 5.1.16299.248
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.16299.248
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Looks like a bug to me since I can start PS with most of the other parameters and the help says -PSConsoleFile is there: from a shell (cmd or powershell) window
powershell /?
...
-PSConsoleFile
Loads the specified Windows PowerShell console file. To create a console
file, use Export-Console in Windows PowerShell.
...

BTW I'm on win 10. You could try stackoverflow or Microsoft. IME stackoverflow will get faster response. Could always try both to test for the fastest...