Skip to content

Conversation

@ishchow
Copy link

@ishchow ishchow commented Mar 18, 2024

Adds powershell script similar to sh script to check if emulator startup completed by pinging emulator cert url.

Here's example output when startup fails (or emulator isn't running):

PS [redacted]> .\Check-EmulatorStartup.ps1 -Timeout $(New-TimeSpan -Seconds 30)
Emulator not reachable within timeout 00:00:30! Last retrieved status code: .
At C:\Repos\Mwc\aspaas\Deployment\scripts\Onebox\Check-EmulatorStartup.ps1:38 char:1
+ throw "Emulator not reachable within timeout $Timeout! Last retrieved ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Emulator not re... status code: .:String) [], RuntimeException
    + FullyQualifiedErrorId : Emulator not reachable within timeout 00:00:30! Last retrieved status code: .

Here's example output when startup succeeds:

PS [redacted]> .\Check-EmulatorStartup.ps1 -Timeout $(New-TimeSpan -Seconds 30)
Emulator startup completed

Tested it on a Windows Server 2022 machine using PowerShell 5.1. But not using anything platform specific in this script, so it should be able to run in PS 7+ so it should work on all platforms PS 7+ supports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant