3/10/2007 9:00am: As an avid PERL scripter, I started my journey into Windows PowerShell
- First I got the latest Windows PowerShell (Code named Nomad - like Gonad?)
- Next, the install goes poorly, all PS1 (*.ps1) files are somehow linked to notepad instead of PowerShell
And I get errors like this if I try to run my first HelloWorld.ps1 file:
"cannot be loaded because the execution of scripts is disabled on this system"- I changed the Windows association of .ps1 files to use:
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe- Then I ran PowerShell and from the prompt I typed:
set-executionpolicy remotesigned- Now I can run my HelloWorld.ps1 script!
My first script was a single line of code (that lists out Windows services):
get-service- Next I tried "TAB Completion" and found that this version is crap!
I use Bash Shell on UNIX all the time and the implementation of tab complete in PowerShell is poorly done.
- Partial matching cycles through non-matching entries (not case sensitive)
- The very useful UNIX ./ (dot slash) matches on non-executable files in PowerShell - confusing and wrong
Windows users still won't know the power of "Tab Completion" until it is correctly implemented.- Lastly, I see references while searching Google that sometimes uninstalling and re-installing PowerShell fixes things
PROBLEM: PowerShell did not put an uninstall icon anywhere, not even in "Add/Remove" programs!
ALSO: Running the installer tells me that I must uninstall before I can re-install!My first hour with PowerShell has been annoying, like years ago when I first used "ActivePERL" for Windows.
Since then, ActiveState has implemented a nearly perfect version of PERL for Windows.
I am trying to stay optimistic, this is only PowerShell version 1.0 and hopefully things will improve!
3/10/2007 10:30am: PowerShell CLI - Test Drive
- Not CMD or Command.com - This is PowerShell!
Start --> Run --> PowerShell- To turn the shell into recognizable "Intrinsic" commands, look at and run:
C:\WINDOWS\system32\windowspowershell\v1.0\examples\profile.ps1
This is like setting "Alias" commands in UNIX
So you can type things like:
ps instead of get-process- Now we know a few basic commands and the UNIX equivalent:
cat = get-content
cd = set-location
clear = clear-host
cp = copy-item
h = get-history
history = get-history
kill = stop-process
lp = out-printer
ls = get-childitem
mount = new-mshdrive
mv = move-item
popd = pop-location
ps = get-process
pushd = push-location
pwd = get-location
r = invoke-history
rm = remove-item
rmdir = remove-item
echo = write-output
cls = clear-host
chdir = set-location
copy = copy-item
del = remove-item
dir = get-childitem
erase = remove-item
move = move-item
rd = remove-item
ren = rename-item
set = set-variable
type = get-content- Life with PowerShell is getting better!
I can do a ps and and a kill and ls!