()
| 440 | } |
| 441 | |
| 442 | function buildNotifyEnvironmentChangedScript(): string { |
| 443 | return `Add-Type -Namespace FlyEnvFallback -Name NativeMethods -MemberDefinition @' |
| 444 | [System.Runtime.InteropServices.DllImport("user32.dll", CharSet = System.Runtime.InteropServices.CharSet.Unicode, SetLastError = true)] |
| 445 | public static extern System.IntPtr SendMessageTimeout(System.IntPtr hWnd, uint Msg, System.UIntPtr wParam, string lParam, uint fuFlags, uint uTimeout, out System.UIntPtr lpdwResult); |
| 446 | '@ |
| 447 | $notifyResult = [System.UIntPtr]::Zero |
| 448 | [FlyEnvFallback.NativeMethods]::SendMessageTimeout( |
| 449 | [System.IntPtr]0xffff, |
| 450 | 0x001A, |
| 451 | [System.UIntPtr]::Zero, |
| 452 | 'Environment', |
| 453 | 0x0002, |
| 454 | 5000, |
| 455 | [ref]$notifyResult |
| 456 | ) | Out-Null` |
| 457 | } |
| 458 | |
| 459 | function validateWriteFileArgs(args: unknown[]): ValidatedWriteFileArgs { |
| 460 | ensureArgCount(args, 2, 'writeFileByRoot') |
no outgoing calls
no test coverage detected