Powershell – Console

Open PowerShell console
It depends of version installed (and OS) so I post a few options:

Powershell - Console_s002

== Starts > All Programs (for PS2: Accessories > Windows PowerShell) and select Windows PowerShell
== Start > Run and type powershell
== On Search box (Start > Search) type powershell and then select Windows Powershell below program’s group
 
Check PowerShell version
You probably have more than one version installed so before continuing check which one you opened by executing the following cmdlet:

$PSVersionTable

The above method is more reliable because it shows the engine version, nevertheless, if you want the current host version execute:

Get-Host

 
Customize PowerShell console home directory
Let’s create a home directory and underneath it, inside one or more folders, organize our own PowerShell scripts (PSS).
The same home directory can be used to deploy other PSS such as application deployments, audit scripts…
== Create an accessible directory on the file system (in my case C:\PSScripts)
== Create a PowerShell desktop shortcut or pin PowerShell to start menu
== Right click on the shortcut and open Properties
== On Start text box (Shortcut tab) type the following:

C:\PSScripts

Powershell - Console_s003

== Click OK and you’re ready to go
 
Customize PowerShell console size color and text
We’ll post about PowerShell profiles but for now let’s customize the console for first use (It’ll be the default to everybody):
== Right click on the PowerShell shortcut and open Properties or click on the console window upper-left-corner control box and select Properties
== On Layout tab adjust Windows size area. New values are:

Width: 150
Height: 80

== Check if Screen buffer size width is equal to windows size area width
== On Font tab select (default values):

Size: 8x12

== On Colors tab select:

. for screen text
Red: 1
Green: 36
Blue: 86
. for screen background
Red: 255
Green: 255
Blue: 255
. for pop-up text
Red: 0
Green: 128
Blue: 128
. for pop-up background
Red: 238
Green: 237
Blue: 240

Note: Just in case you want to go back these are colors tabs default values:

. for screen text
Red: 238
Green: 237
Blue: 240
. for screen background
Red: 1
Green: 36
Blue: 86
. for pop-up text
Red: 0
Green: 128
Blue: 128
. for pop-up background
Red: 255
Green: 255
Blue: 255

 
PowerShell console editing features
Major editing features are:

Keys Editing Operation
Left and right arrows Moves the cursor left and right through the current command line
Ctrl+Left and right arrow Moves the cursor left and right through the current command line, one word at a time
Up and down arrows Move up and down through the list of recently typed commands
Page up and down Jumps to the first and last command in the history buffer
Insert Switches between insert and overstrike text-entry modes
Delete Deletes the character at the current cursor position
Backspace Deletes the character immediately preceding the current cursor position
Home Jumps to the beginning of the command line
End Jumps to the end of the command line
F7 Shows history buffer. Use the up and down arrows to select a command, and press Enter to execute it
Tab Auto-completes command-line sequences. Use the Shift+Tab sequence to move backward through a list of potential matches

 
In Depth / References

http://www.powershellpro.com/powershell-tutorial-introduction/tutorial-windows-powershell-console/

Tested with

PowerShell 2.0

v0.03

Advertisements
Categories: Powershell | Leave a comment

Post navigation

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: