Quickly checking if a problem is a PowerShell problem or a module/snapin/proxy-function problem.

We all tend to customize our PowerShell environment via our Profile.ps1 script.  Whether we load up snapins, modules, our own functions, etc.  And with PowerShell 2.0, you can even “proxy” cmdlets such that you get to intercept calls to cmdlets like Get-Help and add parameters and augment its functionality. Sometimes though this can cause problems.  And it isn’t always easy to determine if the problem is with PowerShell or one of these add-ins.  When I run into these situations I fire up a PowerShell with no profile to help determine where the problem actually lies.  This is what I execute:

C:\PS> PowerShell –noprofile

Often I prefer to have PowerShell fire up in a different window so I use Start-Process.  And because I do this so often (testing PSCX), I’ve created a function that I put in my profile to provide a convenient shortcut to fire up PowerShell with no profile:

function psnp { Start-Process PowerShell.exe -Arg -noprofile }

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

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