Not able to create Powershell profile – psconsolefile

by Jun 27, 2018

Hi Powershell Guru,

I am trying to create a Powershell 5.1 profile on Windows 10 Pro. with the following steps but kept encountering a persistent error:

( i ) C:>dir c:mypreferredconsole.psc
       13-Jun-18  7:10 AM               159 mypreferredconsole.psc

( ii ) The content of C:mypreferredconsole.psc is:
      <?xml version="1.0" encoding="utf-8"?>
      <PSConsoleFile ConsoleSchemaVersion="1.0">
        <PSSnapIns />
( iii ) Create a shortcut on the Desktop. Make the target (the destination) of that shortcut
C:Windowssystem32WindowsPowerShellv1.0powershell.exe -noexit -psconsolefile c:mypreferredconsole.psc

Yet I kept getting the error below in a Powershell window after double clicked the shortcut :

-psconsoleFile : The term '-psconsoleFile' 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:1
+ -psconsoleFile c:mypreferredconsole.psc
+ ~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (-psconsoleFile:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Changing suffix .psc to .psc1 did not make any difference.

Thanks in advance,