kennysarmy Posted January 13, 2014 Posted January 13, 2014 I'm on windows 7 64bit. I open Windows PowerShell as Administrator and "Set-ExecutionPolicy RemoteSigned" I find the default profile location and created a ps1 file called "Microsoft.PowerShell_profile.ps1" with the following lines: $Shell = $Host.UI.RawUI $Shell.WindowTitle=”PowerShell Obeys Me” $Shell.BackgroundColor=”White” $Shell.ForegroundColor=”Blue” $size = $Shell.WindowSize $size.width=120 $size.height=55 $Shell.WindowSize = $size $size = $Shell.BufferSize $size.width=120 $size.height=5000 $Shell.BufferSize = $size Clear-Host However when I subsequently open up powershell I am greeted with the following errors: Windows PowerShell Copyright © 2012 Microsoft Corporation. All rights reserved. â??PowerShell : The term 'â??PowerShell' 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 \\fp2\ja$\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:2 char:20 + $Shell.WindowTitle=â??PowerShell Obeys Meâ?? + ~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (â??PowerShell:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException â??Whiteâ?? : The term 'â??Whiteâ??' 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 \\fp2\ja$\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:3 char:24 + $Shell.BackgroundColor=â??Whiteâ?? + ~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (â??Whiteâ??:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException â??Blueâ?? : The term 'â??Blueâ??' 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 \\fp2\ja$\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:4 char:24 + $Shell.ForegroundColor=â??Blueâ?? + ~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (â??Blueâ??:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS H:\>
Arcath Posted January 13, 2014 Posted January 13, 2014 Looks to me like the " have been replaced with characters that look like " but aren't
kennysarmy Posted January 14, 2014 Author Posted January 14, 2014 Indeed - weird - when opening up the PS1 file in Notepad it looked fine, but when opening up in the ISE the " in some cases had changed to the weird characters...not sure why but it's sorted now - thanks.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now