Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 6 years and 5 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
function Check-Service1-Remote
{
$result1 = Invoke-Command -ComputerName $script:LocalServer -ScriptBlock { Get-Service $Service1_Name } -Credential $script:Cred -Authentication Kerberos
if ($result1.Status -eq 'Running')
{
do stuff
}
}
the problem is that the $result1 is getting all the services and not just the one i pass in the variable Service1_Name.
i tired configuring the $Service1_Name as $script:Service1_Name but it didnt work as well...
This topic is 6 years and 5 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.