|
@ -30,7 +30,19 @@ $Parameters = @{ |
|
|
UseBasicParsing = $true |
|
|
UseBasicParsing = $true |
|
|
} |
|
|
} |
|
|
$LatestGitHubRelease = (Invoke-RestMethod @Parameters).tag_name |
|
|
$LatestGitHubRelease = (Invoke-RestMethod @Parameters).tag_name |
|
|
$DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}" |
|
|
|
|
|
|
|
|
if ((Get-Location).Path -eq $env:USERPROFILE) |
|
|
|
|
|
{ |
|
|
|
|
|
$DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}" |
|
|
|
|
|
} |
|
|
|
|
|
elseif ((Get-Location).Path -eq "$env:SystemRoot\System32") |
|
|
|
|
|
{ |
|
|
|
|
|
$DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}" |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
$DownloadsFolder = (Get-Location).Path |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if ($Wrapper) |
|
|
if ($Wrapper) |
|
|
{ |
|
|
{ |
|
@ -225,11 +237,11 @@ $SetForegroundWindow = @{ |
|
|
Name = "ForegroundWindow" |
|
|
Name = "ForegroundWindow" |
|
|
Language = "CSharp" |
|
|
Language = "CSharp" |
|
|
MemberDefinition = @" |
|
|
MemberDefinition = @" |
|
|
[DllImport("user32.dll")] |
|
|
[DllImport("user32.dll")] |
|
|
public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow); |
|
|
public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow); |
|
|
[DllImport("user32.dll")] |
|
|
[DllImport("user32.dll")] |
|
|
[return: MarshalAs(UnmanagedType.Bool)] |
|
|
[return: MarshalAs(UnmanagedType.Bool)] |
|
|
public static extern bool SetForegroundWindow(IntPtr hWnd); |
|
|
public static extern bool SetForegroundWindow(IntPtr hWnd); |
|
|
"@ |
|
|
"@ |
|
|
} |
|
|
} |
|
|
if (-not ("WinAPI.ForegroundWindow" -as [type])) |
|
|
if (-not ("WinAPI.ForegroundWindow" -as [type])) |
|
|