PS CE portable

Topics: User Forum
Nov 22, 2010 at 9:14 PM

Hi everyone,

I'm wondering if there is a way to use the PS CE's running off of a thumb drive that would be referenced from a powershell script?  The main reason is due to the equipment I work on our customers are very picky about installing items on there servers.  The script is being used to install approved Microsoft hotfixes from the vendor we support.

My thought is to copy the Pscx directory to my directory where I run the PowerShell script and then Import-Module from that directory.  I tried, but the script bombed.

Any ideas?

Developer
Nov 22, 2010 at 9:39 PM
-Oisin

On Mon, Nov 22, 2010 at 4:14 PM, mprindle <notifications@codeplex.com> wrote:

From: mprindle

Hi everyone,

I'm wondering if there is a way to use the PS CE's running off of a thumb drive that would be referenced from a powershell script? The main reason is due to the equipment I work on our customers are very picky about installing items on there servers. The script is being used to install approved Microsoft hotfixes from the vendor we support.

My thought is to copy the Pscx directory to my directory where I run the PowerShell script and then Import-Module from that directory. I tried, but the script bombed.

Any ideas?

Read the full discussion online.

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

To start a new discussion for this project, email Pscx@discussions.codeplex.com@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
Developer
Nov 25, 2010 at 3:17 PM

Portable PowerShell sounds a bit over the top when all he wants is Portable PSCX.

I do this all the time: I have a thumbdrive with my whole WindowsPowershell folder in it, with my profile and everything ... and I have a loader script which I dot-source...

 

The key is:

  1. Put PSCX in a folder, eg: if F: is your thumbdrive, you should have (at least) F:\Modules\PSCX (mine is: F:\Data\WindowsPowerShell\Modules\PSCX).
  2. Add the parent folder to $Env:PSModulePath eg: just run:  $Env:PSModulePath = "${Env:PSModulePath};F:\Data\WindowsPowerShell\Modules"
  3. Import-Module PSCX

That should work

 

Developer
Nov 25, 2010 at 8:57 PM
Oh, I misunderstood that - I read it quickly and thought he was talking about powershell itself.

On Thu, Nov 25, 2010 at 10:17 AM, Jaykul <notifications@codeplex.com> wrote:

From: Jaykul

Portable PowerShell sounds a bit over the top when all he wants is Portable PSCX.

I do this all the time: I have a thumbdrive with my whole WindowsPowershell folder in it, with my profile and everything ... and I have a loader script which I dot-source...

The key is:

  1. Put PSCX in a folder, eg: if F: is your thumbdrive, you should have (at least) F:\Modules\PSCX (mine is: F:\Data\WindowsPowerShell\Modules\PSCX).
  2. Add the parent folder to $Env:PSModulePath eg: just run: $Env:PSModulePath = "${Env:PSModulePath};F:\Data\WindowsPowerShell\Modules"
  3. Import-Module PSCX

That should work

Read the full discussion online.

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

To start a new discussion for this project, email Pscx@discussions.codeplex.com@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
Nov 29, 2010 at 4:43 PM
Jaykul wrote:

Portable PowerShell sounds a bit over the top when all he wants is Portable PSCX.

I do this all the time: I have a thumbdrive with my whole WindowsPowershell folder in it, with my profile and everything ... and I have a loader script which I dot-source...

 

The key is:

  1. Put PSCX in a folder, eg: if F: is your thumbdrive, you should have (at least) F:\Modules\PSCX (mine is: F:\Data\WindowsPowerShell\Modules\PSCX).
  2. Add the parent folder to $Env:PSModulePath eg: just run:  $Env:PSModulePath = "${Env:PSModulePath};F:\Data\WindowsPowerShell\Modules"
  3. Import-Module PSCX

That should work

 

Wonderful!  That will work great.  The only hickup I had was, I was trying to put the PSCX directory into the path which it didn't like.  Once I looked at your path again I mumbled and fixed my mistake. :)

Thanks for the help.  PSCX is going to make my life easier in my scripts.