Wednesday, October 24, 2007

Notes Windows Power Shell

Notes Windows Power Shell
=======================


Contents
=========
Commands
Scripting
Printing
Digital Signing and Certificates
Search





Commands
=========
get-alias list the real name of old command
get-content list contents of file
get-help get-service help on get-service command
get-command *-service list commands that manipulate services
get-member list the members of the object
get-service list the services running
| Out-Host -Paging prints one page at a time, user scrolling


Scripting
============
1. Extension *.ps1 (p-s-One)
2. To run script
/file.ps1 absolute path
./file.ps1 relative path
3. Line continuation '
4. Execution policy to run on local machine,
Set-ExecutionPolicy remoteSigned
5. Comments starts with #


Printing
==========
To print to a printer:
...blah... | Out-Printer -name "\\iaunsw024.au.cbainet.com\SYD48MP-L8-LXOP"

Search
=======
- Select-String
- findstr

No comments: