Skip to content

Commit 14b5e7e

Browse files
authored
Merge pull request #63 from AutomateThePlanet/fix/incorrect-variable-reference
2 parents cdca4a7 + a0afceb commit 14b5e7e

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

lib/commands/functions.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -152,18 +152,18 @@ export const PAGE_SOURCE = pwsh /* ps1 */ `
152152
$pattern = $null
153153
154154
if ($element.TryGetCurrentPattern([WindowPattern]::Pattern, [ref]$pattern)) {
155-
$newXmlElement.SetAttribute("CanMaximize", $windowPattern.Current.CanMaximize)
156-
$newXmlElement.SetAttribute("CanMinimize", $windowPattern.Current.CanMinimize)
157-
$newXmlElement.SetAttribute("IsModal", $windowPattern.Current.IsModal)
158-
$newXmlElement.SetAttribute("WindowVisualState", $windowPattern.Current.WindowVisualState)
159-
$newXmlElement.SetAttribute("WindowInteractionState", $windowPattern.Current.WindowInteractionState)
160-
$newXmlElement.SetAttribute("IsTopmost", $windowPattern.Current.IsTopmost)
155+
$newXmlElement.SetAttribute("CanMaximize", $pattern.Current.CanMaximize)
156+
$newXmlElement.SetAttribute("CanMinimize", $pattern.Current.CanMinimize)
157+
$newXmlElement.SetAttribute("IsModal", $pattern.Current.IsModal)
158+
$newXmlElement.SetAttribute("WindowVisualState", $pattern.Current.WindowVisualState)
159+
$newXmlElement.SetAttribute("WindowInteractionState", $pattern.Current.WindowInteractionState)
160+
$newXmlElement.SetAttribute("IsTopmost", $pattern.Current.IsTopmost)
161161
}
162162
163163
if ($element.TryGetCurrentPattern([TransformPattern]::Pattern, [ref]$pattern)) {
164-
$newXmlElement.SetAttribute("CanRotate", $windowPattern.Current.CanRotate)
165-
$newXmlElement.SetAttribute("CanResize", $windowPattern.Current.CanResize)
166-
$newXmlElement.SetAttribute("CanMove", $windowPattern.Current.CanMove)
164+
$newXmlElement.SetAttribute("CanRotate", $pattern.Current.CanRotate)
165+
$newXmlElement.SetAttribute("CanResize", $pattern.Current.CanResize)
166+
$newXmlElement.SetAttribute("CanMove", $pattern.Current.CanMove)
167167
}
168168
169169
# TODO: more to be added depending on the available patterns
@@ -189,4 +189,4 @@ export const PAGE_SOURCE = pwsh /* ps1 */ `
189189
190190
return $xmlElement
191191
}
192-
`;
192+
`;

lib/commands/powershell.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const INIT_ELEMENT_TABLE = /* ps1 */ `$elementTable = New-Object System.Collecti
1414
export async function startPowerShellSession(this: NovaWindowsDriver): Promise<void> {
1515
const powerShell = spawn('powershell.exe', ['-NoExit', '-Command', '-']);
1616
powerShell.stdout.setEncoding('utf8');
17-
powerShell.stdout.setEncoding('utf8');
17+
powerShell.stderr.setEncoding('utf8');
1818

1919
powerShell.stdout.on('data', (chunk: any) => {
2020
this.powerShellStdOut += chunk.toString();

0 commit comments

Comments
 (0)