mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/63440 Signed-off-by: Eli Uriegas <eliuriegas@fb.com> Test Plan: Imported from OSS Reviewed By: janeyx99 Differential Revision: D30521460 Pulled By: seemethere fbshipit-source-id: e987e170e73fb4f9d9f024bed0e58404ed206848
18 lines
582 B
PowerShell
18 lines
582 B
PowerShell
function Get-SSH-Users {
|
|
# Gets ssh sessions for all users not named SYSTEM
|
|
Get-CimInstance -ClassName Win32_Process -Filter "Name = 'sshd.exe'" |
|
|
Get-CimAssociatedInstance -Association Win32_SessionProcess |
|
|
Get-CimAssociatedInstance -Association Win32_LoggedOnUser |
|
|
Where-Object {$_.Name -ne 'SYSTEM'} |
|
|
Measure-Object
|
|
}
|
|
|
|
$usersLoggedOn = Get-SSH-Users
|
|
|
|
Write-Output "Holding runner until all ssh sessions have logged out"
|
|
while ($usersLoggedOn.Count -gt 0) {
|
|
$usersLoggedOn = Get-SSH-Users
|
|
Write-Output "."
|
|
Start-Sleep -s 5
|
|
}
|