I'm trying to pass some arguments into a new Powershell remoting session using the PSSessionOption's ApplicationArguments property. Unfortunately, the arguments don't seem to show up.
Here's the code:
$client = "Bubba"
$options = New-PSSessionOption -ApplicationArguments @{ Client = $client }
Enter-PSSession -ComputerName "Server" -SessionOption $options
$clientName = $PSSenderInfo.ApplicationArguments.Client
$dir = New-Item "c:\temp\$clientName" -type directory
Exit-PSSession
This results in an error: "NewNotImplementedException at offset 101 in file:line:column..."
Am I doing something wrong?