+ Post New Thread
Results 1 to 3 of 3
Coding Thread, Getting started with PowerShell - but error on running default profile. in Coding and Web Development; I'm on windows 7 64bit. I open Windows PowerShell as Administrator and "Set-ExecutionPolicy RemoteSigned" I find the default profile location ...
  1. #1
    kennysarmy's Avatar
    Join Date
    Oct 2005
    Location
    UK
    Posts
    1,254
    Thank Post
    75
    Thanked 45 Times in 31 Posts
    Rep Power
    30

    Getting started with PowerShell - but error on running default profile.

    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 (C) 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_p rofile.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_p rofile.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_p rofile.ps1:4 char:24
    + $Shell.ForegroundColor=‚??Blue‚??
    + ~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (‚??Blue‚??:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

    PS H:\>

  2. #2
    Arcath's Avatar
    Join Date
    Feb 2009
    Location
    Lancashire
    Posts
    935
    Thank Post
    99
    Thanked 107 Times in 95 Posts
    Rep Power
    72
    Looks to me like the " have been replaced with characters that look like " but aren't

  3. #3
    kennysarmy's Avatar
    Join Date
    Oct 2005
    Location
    UK
    Posts
    1,254
    Thank Post
    75
    Thanked 45 Times in 31 Posts
    Rep Power
    30
    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.

SHARE:
+ Post New Thread

Similar Threads

  1. Getting started with Citrix VDI
    By RobD in forum Thin Client and Virtual Machines
    Replies: 4
    Last Post: 25th November 2013, 08:07 PM
  2. Replies: 1
    Last Post: 14th March 2011, 08:50 AM
  3. Getting started with a Mac network
    By birchanger in forum Mac
    Replies: 2
    Last Post: 18th May 2009, 07:48 PM
  4. Getting started with GPOs
    By laserblazer in forum Wireless Networks
    Replies: 1
    Last Post: 30th June 2008, 10:09 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •