Hi
I am having issue with issuing iscsicli.exe in remote session via script.
Following lines are failing:
$command = "iscsicli RefreshTargetPortal $using:ISCSITargetIP 3260 ROOT\ISCSIPRT\0000_0 1"
Invoke-Expression $command
Write-host "Adding ISCSI target - on port $using:index"
$command = "iscsicli addtargetportal $using:ISCSITargetIP 3260 ROOT`\ISCSIPRT`\0000_0 $using:index * * * * * * * * * *"
Invoke-Expression $command
When command are executed in script they are failing - when i execute those commands via entering pssession and executing one by one - all works, when i logon to target server and execute them one by one ... all works.
Can anyone tell me why this is happening?
Michał