Compatibility with PS V2 CTP 3?

Jan 15, 2009 at 12:34 PM
What is the current level of compatibility of the trunk with PS V2 CTP 3?

I am more than willing to build off of trunk if need be (actually I am running an older custom build right now) but before I goto the effort of updating to CTP 3 rebuilding PSCX and then finding out there is some fundamental incompatibility I thought I would ask.

Anybody running with PS V2 CTP 3?

-mark
Jan 15, 2009 at 5:49 PM
I am.  I just tried to install PSCX on PS V2 CTP3 and it errors out.
Jan 15, 2009 at 6:07 PM
Sorry, was just posting fast before.  Here is the errors I get when I installed it and ran PowerShell.

Attempting to perform the InitializeDefaultDrives operation on the 'DirectoryServices' provider failed.
Add-PSSnapin : Windows PowerShell snap-in "Pscx" is loaded with the following warnings:  Error loading the extended type data
e:
Pscx, C:\Program Files\PowerShell Community Extensions\TypeData\FileSystem.ps1xml(19) : Error in type "System.IO.FileInfo": Me
r "BaseName" is already present.
At O:\WindowsPowerShell\profile.ps1:98 char:14
+     Add-PSSnapin <<<<  Pscx
    + CategoryInfo          : InvalidData: (Pscx:String) [Add-PSSnapin], PSSnapInException
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

Set-Alias : Alias is not writeable because alias measure is read-only or constant and cannot be written to.
At O:\WindowsPowerShell\profile.ps1:79 char:11
+     Set-Alias <<<<  $name $value -Scope Global -Option AllScope -Force:$force -Description "PSCX $type alias"
    + CategoryInfo          : WriteError: (measure:String) [Set-Alias], SessionStateUnauthorizedAccessException
    + FullyQualifiedErrorId : AliasNotWritable,Microsoft.PowerShell.Commands.SetAliasCommand

Set-Alias : Alias is not writeable because alias start is read-only or constant and cannot be written to.
At O:\WindowsPowerShell\profile.ps1:79 char:11
+     Set-Alias <<<<  $name $value -Scope Global -Option AllScope -Force:$force -Description "PSCX $type alias"
    + CategoryInfo          : WriteError: (start:String) [Set-Alias], SessionStateUnauthorizedAccessException
    + FullyQualifiedErrorId : AliasNotWritable,Microsoft.PowerShell.Commands.SetAliasCommand

Set-Alias : Alias is not writeable because alias gcs is read-only or constant and cannot be written to.
At C:\Program Files\PowerShell Community Extensions\Profile\Debug.ps1:72 char:10
+ set-alias <<<<  gcs Get-CallStack -Option AllScope -Description "PSCX function alias"
    + CategoryInfo          : WriteError: (gcs:String) [Set-Alias], SessionStateUnauthorizedAccessException
    + FullyQualifiedErrorId : AliasNotWritable,Microsoft.PowerShell.Commands.SetAliasCommand

Set-Alias : Alias is not writeable because alias ebp is read-only or constant and cannot be written to.
At C:\Program Files\PowerShell Community Extensions\Profile\Debug.ps1:89 char:10
+ set-alias <<<<  ebp Enable-Breakpoints -Option AllScope -Description "PSCX function alias"
    + CategoryInfo          : WriteError: (ebp:String) [Set-Alias], SessionStateUnauthorizedAccessException
    + FullyQualifiedErrorId : AliasNotWritable,Microsoft.PowerShell.Commands.SetAliasCommand

Set-Alias : Alias is not writeable because alias dbp is read-only or constant and cannot be written to.
At C:\Program Files\PowerShell Community Extensions\Profile\Debug.ps1:103 char:10
+ set-alias <<<<  dbp Disable-Breakpoints -Option AllScope -Description "PSCX function alias"
    + CategoryInfo          : WriteError: (dbp:String) [Set-Alias], SessionStateUnauthorizedAccessException
    + FullyQualifiedErrorId : AliasNotWritable,Microsoft.PowerShell.Commands.SetAliasCommand

Split-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Program Files\PowerShell Community Extensions\Profile\Environment.VisualStudio2005.ps1:39 char:21
+ $VSPath = split-path <<<<  $VisualStudioKey.InstallDir -Parent | split-path -Parent
    + CategoryInfo          : InvalidData: (:) [Split-Path], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.SplitPathCommand

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Program Files\PowerShell Community Extensions\Profile\Environment.VisualStudio2005.ps1:40 char:20
+ $VCPath = join-path <<<<  $VSPath 'VC'
    + CategoryInfo          : InvalidData: (:) [Join-Path], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

Test-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Program Files\PowerShell Community Extensions\Profile\Environment.VisualStudio2005.ps1:42 char:14
+ if (test-path <<<<  $VSPath) {
    + CategoryInfo          : InvalidData: (:) [Test-Path], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.TestPathCommand

1#

Just thought it might help for anyone interested.

Rob

Coordinator
Jan 20, 2009 at 5:54 AM
Sorry guys, we really do need to get an update out.  My work has kept me insanely busy the past 6 months but my current project will be done in the next two weeks.  After that, Oisin and I will focus on getting 1.2 out the door.
Feb 1, 2009 at 8:33 PM
I ran into the same problems and did the following to clear up the "Set-Alias" issues:

Edit GenericAliases.ps1 by adding the -force switch to the line that sets the "measure" alias
Edit PscxAliases.ps1 by adding the -force switch to the line that sets the "start" alias
Edit Debug.ps1 by adding the -force switch to the lines that set the "gcs", "epb", and "dbp" aliases

You'll need to follow the instructions here:  http://www.codeplex.com/PowerShellCX/Release/ProjectReleases.aspx?ReleaseId=2688 regarding using PSCX with any of the V2 offerings which will eliminate the FileSystem.ps1xml error.   In short run the following (once)

$path = "$((get-pssnapin -r pscx).applicationbase)\typedata\filesystem.ps1xml"
$config = [xml](gc $path)
$config.Types.removechild($config.Types.Type[1])
$config.get_outerXML() > $path
update-typedata

The fixes above should get you going until a full update is published.

Your drive initialization problem has nothing to do with PSCX and is more than likely the result of your computer having SoftGrid on it and a "Q:" drive that cannot be accessed.  The other errors related to your Visual Studio path would indicate to me that you don't have Visual Studio installed and likely just need to comment out the portion of the PSCX canned profile script that loads and Visual Studio add-ins.

-Brian
Feb 6, 2009 at 3:17 AM
Hey Brian,

thanx for the above tips, worked a gem.

I still however receive "Attempting to perform the InitializeDefaultDrives operation on the 'DirectoryServices' provider failed." - from what I can tell, this is the only other obvious error generated by PSCX with CTP3

I tried the following command hoping for a change to no avail:

New-PSDrive -Name "Q" -PSProvider DirectoryServices -Root "." -Credential (Get-Credential)    (feel free to comment on my syntax)

I do not use softgrid, sms or have Q: drive mapped.

The DirectoryServices provider was the main reason I dumped a competing product so I hope this is easy to fix.

Simon Savva

P.S. I use PowerShellPlus as my main console so it may be related to that host, though as it stands, I doubt it.
Feb 6, 2009 at 4:32 AM
Um, Sorry to reply to myself ;-) but thought I'd better update:

A second ago I had a woohoo/ahha moment!

New-PSDrive -Name "<yourchoice>" -PSProvider DirectoryServices -Credential (Get-Credential) -root "<dc>"

That did it nicely!!!

Feel free to let me know if you think this fix will cause problems

Simon Savva
Feb 9, 2009 at 4:14 PM
Simon,

I'm sorry I made the assumption regarding your failed PSDrive message, I should have read the error more closely.  Good fix!

-Brian
Coordinator
Feb 10, 2009 at 4:19 PM
We've gotten a few requests to not automatically initialize the DirectoryServices provider.  What do you guys think?  If you want it you could still have it by adding the New-PSDrive command to your profile?
Feb 10, 2009 at 11:12 PM
Actually, that would be ace. It would mean lack of errors when I don't want to run my host elevated or I'm in a non domain situation.
Developer
Feb 11, 2009 at 2:59 AM
Yeah, that sounds like a good idea.  I think PSCX would benefit from a little modularization now that modules can indicate their dependencies....
Feb 17, 2009 at 4:23 AM
I agree, removing the initialization of the DirectoryServices provider would be great as long as the New-PSDrive method to setup an AD drive if required is available.
Mar 3, 2009 at 4:15 AM
I agree with brjack.  Keep it available but don't initialize the psdrive.
Mar 8, 2009 at 4:44 PM
get-help *

The 'get-help *' command causes the following error on my installation of CTP 3 and Pscx:

Get-Help : The term 'Start-Process' resolved to a cmdlet name that is ambiguous.  Possible matches include: Pscx\Start-Process Microsoft.PowerShell.Management\Start-Process.
At line:1 char:9
+ get-help <<<<   *
...


Is there a fix?  Thanks!
Jun 25, 2009 at 2:50 PM

Same problem

get-help *

PS:1 >help *
Get-Help : The term 'Start-Process' resolved to a cmdlet name that is ambiguous. Possible matches i
nclude: Pscx\Start-Process Microsoft.PowerShell.Management\Start-Process.
At C:\Program Files\PowerShell Community Extensions\Scripts\Get-PagedHelp.ps1:114 char:10
+ get-help <<<< $Name -Category $Category | pager
  + CategoryInfo : ObjectNotFound: (Start-Process:String) [Get-Help], CommandNotFoundEx
  ception
  + FullyQualifiedErrorId : CmdletNameAmbiguous,Microsoft.PowerShell.Commands.GetHelpCommand

Developer
Jun 25, 2009 at 3:55 PM

Uhoh ... that one looks like a PowerShell bug ... let me see what I can figure out