How to stop an asynchronous PowerShell scriptblock?
Just like Invoke()
has an asynchronous Begin/End pair, so does Stop()
.
You can wrap them like this to stop invocation:
$ps.EndStop($ps.BeginStop($null,$asyncObject))
Just like Invoke()
has an asynchronous Begin/End pair, so does Stop()
.
You can wrap them like this to stop invocation:
$ps.EndStop($ps.BeginStop($null,$asyncObject))