mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
28 lines
411 B
Plaintext
Executable File
28 lines
411 B
Plaintext
Executable File
#!/usr/bin/expect -f
|
|
|
|
exp_internal 1
|
|
|
|
# Expects path to PowerShell as first argument
|
|
set powershell [lindex $argv 0]
|
|
|
|
set timeout 60
|
|
|
|
spawn $powershell -nologo -noprofile Read-Host prompt
|
|
|
|
expect "prompt: $" {
|
|
send "input\r"
|
|
}
|
|
|
|
# This is the old, incorrect behavior
|
|
expect "input\r\ninput\r" {
|
|
exit 2
|
|
}
|
|
|
|
# This is the expected behavior
|
|
expect "input\r\n" {
|
|
exit 0
|
|
}
|
|
|
|
# Anything else is wrong
|
|
exit 1
|