I gang

PowersShell Syntax returning value of variable "Invoke-Command"

Please see this code; the value of $mypoolstate ends up being blank, this was already tested without Invoke-Command worked like a champ. Please help me make this code work and fix my syntax?

$scriptBlock = {

param([string] $mypoolname)

$mypoolstate=$(Get-WebAppPoolState= $mypoolname).Value;

}

Invoke-Command -ComputerName $myserver - ScriptedBlock $scriptBlock

Write-Host "value of mypoolstate is: " $mypoolstate

Evner: Powershell, DOS, Windows Server, IIS, Windows Mobil

Se mere: color value jsp, netconnectioncall method able invoke server side method command, php variable value pass next page without post, powershell invoke-command argumentlist, invoke-command multiple commands, invoke-command credential, invoke-command asjob, invoke-command return value, powershell invoke-expression, invoke-command scriptblock variable, invoke-command localhost, creating number columns based variable value html, perl include external file variable syntax, flash fla replace value variable, blue host change variable mysql, command good english write book, host fix, perlredirect command variable, wc3 bot host command, invoke command ussd

Om arbejdsgiveren:
( 186 bedømmelser ) Lyndhurst, United States

Projekt ID: #20328916