enter-pssession & get-childitem in powershell3 - by didierlux

Status : 

 


1
0
Sign in
to vote
ID 781011 Comments
Status Active Workarounds
Type Bug Repros 0
Opened 3/8/2013 7:58:46 AM
Access Restriction Public

Description

get-childitem does not work with specific parameters in a remote pssession.

Client is: windows8 
Server: windows 2008 r2 with powershell3

1) enter-pssession somehost -credential $cred

2)
[somehost]: PS C:\> Get-ChildItem -Attributes !Directory+!System+Encrypted, !Directory+!System+Compressed
Cannot bind parameter 'Attributes'. Cannot convert the "System.Collections.ArrayList" value of type "System.Collections.ArrayList" to type
"System.Management.Automation.FlagsExpression`1[System.IO.FileAttributes]".
    + CategoryInfo          : InvalidArgument: (:) [Get-ChildItem], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.GetChildItemCommand

3)
[somehost]: PS C:\> $host
Name             : ServerRemoteHost
Version          : 1.0.0.0
InstanceId       : eebb6869-992a-4b6c-b7cb-f5faa754c214
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : en-US
CurrentUICulture : en-US
PrivateData      :
IsRunspacePushed :
Runspace         :
Sign in to post a comment.