Skip to content

Commit

Permalink
Fix WindowStyle tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapatwardhan committed Feb 14, 2023
1 parent 0bc6bf1 commit be30e42
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/powershell/Host/ConsoleHost.Tests.ps1
Expand Up @@ -952,8 +952,16 @@ Describe "WindowStyle argument" -Tag Feature {

if ($IsWindows)
{
$ExitCodeBadCommandLineParameter = 64
Add-Type -Name User32 -Namespace Test -MemberDefinition @"
$sessionId = Get-Process -Id $PID | Select-Object -Property SessionId

if ($sessionId -eq 0) {
$PSDefaultParameterValues["it:skip"] = $true
Write-Warning "This test requires a non-default session ID."
}
else {

$ExitCodeBadCommandLineParameter = 64
Add-Type -Name User32 -Namespace Test -MemberDefinition @"
public static WINDOWPLACEMENT GetPlacement(IntPtr hwnd)
{
WINDOWPLACEMENT placement = new WINDOWPLACEMENT();
Expand Down Expand Up @@ -987,6 +995,7 @@ public enum ShowWindowCommands : int
Maximized = 3,
}
"@
}
}
}

Expand Down

0 comments on commit be30e42

Please sign in to comment.