Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

PowerShell + iscsicli

$
0
0

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ł


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>