< Back

Wait-AMAgent

Sat Jan 11, 2020 3:44 am

NAME Wait-AMAgent



SYNOPSIS

Waits for AutoMate Enterprise agent to go online or offline.





SYNTAX

Wait-AMAgent [-Online] [-Timeout <Object>] [<CommonParameters>]



Wait-AMAgent [-InputObject <Object>] [-Online] [-Timeout <Object>] [<CommonParameters>]





DESCRIPTION

Wait-AMAgent waits for an agent to online or offline.





PARAMETERS

-InputObject <Object>

The agents to wait for.



Required? false

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Online [<SwitchParameter>]

Specify whether to wait for the agent to go online or offline (-Online:$false)



Required? false

Position? named

Default value True

Accept pipeline input? false

Accept wildcard characters? false



-Timeout <Object>

Seconds to wait for the agent status to change before timing out.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

Agents can be supplied on the pipeline to this function.





OUTPUTS

System.Object[]





-------------------------- EXAMPLE 1 --------------------------



PS C:\\># Wait for all offline agents to come online



Get-AMAgent | Where-Object {-not $_.Online} | Wait-AMAgent



# Wait for agent 'agent01' to go offline

Get-AMAgent -Name agent01 | Wait-AMAgent -Online:$false











RELATED LINKS

https://github.com/AutomatePS/AutomatePS