Installation Guide for Dummies

Topics: User Forum
Jan 4, 2011 at 10:44 AM
Edited Jan 4, 2011 at 10:44 AM

Hello

The installation guide seems to have been written by a PowerShell expert making notes for his own consumption. Can someone write, in plain English, a step-by-step guide to its installation, please?

I've noticed a number of people having problems getting this thing off the ground so I assume there are many more people that fumble through on their own. I've read the Release Notes and am immediately confused:

$env:Home\Documents\WindowsPowerShell\Modules means nothing to me.

My 19 years scripting and programming on Windows seems to be failing me when it comes to PowerShell. I feel like I've woken up in a parallel universe in which Bill Gates is a Finnish guy called Linus Torvalds.

Thanks for your help,

Luke

 

Developer
Jan 10, 2011 at 2:45 AM
Edited Jan 10, 2011 at 2:49 AM

Hi Luke,

I'm sorry to hear you're having difficulty transitioning to PowerShell. The PowerShell variable $env:home is the equivalent of %HOME% in cmd.exe or command.com; it's an environment variable, a type of system-wide variable that has existed far longer than your 19 years in scripting ;)

As regards the PowerShell module installation/usage and overall concepts, we [the developers of pscx] did not invent this system. It is fully documented on http://msdn.microsoft.com/en-us/library/dd901839(v=vs.85).aspx (Windows PowerShell Module Concepts.)

As regards the "unblock" procedure, this is something that is new since Windows Vista (go figure) and catches a lot of people off guard as the symptoms of "blocked" files vary depending on the circumstance of their usage. See http://www.petri.co.il/unblock-files-windows-vista.htm for a decent explanation of that one. Again, not our doing.

-Oisin

Jan 10, 2011 at 9:52 AM
Edited Jan 10, 2011 at 9:53 AM

Thanks Oisin,

I'll get started on those links. And one day I'll convert Streams.exe to a cmdlet so one can unblock from PowerShell itself.

One question remains: do I need to setup a %HOME% environment variable, since I don't have one currently. And what would I set it to (what's its purpose)?

Thanks again,

Luke

Developer
Jan 10, 2011 at 4:17 PM
Edited Jan 10, 2011 at 4:19 PM

Hi Luke,

You know what, I think we've got a problem in our install script :)

Just for kicks, I went to double check $env:home / %home% on my machine and I don't have it either. I could have sworn it existed before, but I can't recall the last time I used it as within powershell I always use the tilde "~" to bring me to my home directory, which is typically c:\users\oisin. In our scripts we assume you are "dogfooding" and actually using powershell to copy things around, but if you find yourself using windows explorer, then $env:home is meant to represent the root of your home directory, c:\users\luke (for example.) In powershell, you can do this:

ps c:\> cd ~
ps c:\users\oisin>

The tilde is a construct borrowed from the unix world (and was missed by those of us familiar with that world and finding ourselfs on the paltry cmd.exe platform.)

Btw, don't kill yourself trying to port streams.exe as a cmdlet - and I'm not saying it wouldn't be nice - but a lot of people get fixated on trying to port perfectly usable tools to powershell, forgetting that powershell is just that: a shell. It's not trying to be an all-in-one console operating system. Bash is pretty minimal itself - awk, sed, gawk, ls etc are all external, just like robocopy.exe (a common request to port) and streams.exe are.

-Oisin

Jan 11, 2011 at 2:58 PM

Cheers Oisin, I've become snowed under with work so I can't come back to you with any findings yet.

Luke

Jan 14, 2011 at 5:34 PM

I think $env:Home\Documents\WindowsPowerShell\Modules should be:

$home\Documents\WindowsPowerShell\Modules on Vista+

and

"$home\My Documents\WindowsPowerShell\Modules" on Windows XP.

--Greg

Developer
Jan 14, 2011 at 6:10 PM
What's even more reliable is:
Join-Path ([environment]::GetFolderPath("MyDocuments")) "WindowsPowerShell\Modules"
This is always correct for all platforms: xp, vista, win7. It also works if your home directory has been redirected.
-Oisin
-

On Fri, Jan 14, 2011 at 1:34 PM, gwojan <notifications@codeplex.com> wrote:

From: gwojan

I think $env:Home\Documents\WindowsPowerShell\Modules should be:

$home\Documents\WindowsPowerShell\Modules on Vista+

and

"$home\My Documents\WindowsPowerShell\Modules" on Windows XP.

--Greg

Read the full discussion online.

To add a post to this discussion, reply to this email (Pscx@discussions.codeplex.com)

To start a new discussion for this project, email Pscx@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com




--

---
404 signature missing
Jan 14, 2011 at 7:57 PM

Nice. :)

I keep forgetting about [Environment]::GetFolderPath().  I'm adding it to my profile now so maybe I won't forget for a while. ;)