diff --git a/upd.ps1 b/upd.ps1 index fe96f03..ad1cd04 100644 --- a/upd.ps1 +++ b/upd.ps1 @@ -1,4 +1,6 @@ -Invoke-Command -ComputerName . -AsJob -Scriptblock { - Start-Sleep -s 5 - Start-Process notepad.exe -} +#Hiding PS console +Add-Type -Name win -MemberDefinition '[DllImport("user32.dll")] public static extern bool ShowWindow(int handle, int state);' -Namespace native +[native.win]::ShowWindow(([System.Diagnostics.Process]::GetCurrentProcess() | Get-Process).MainWindowHandle,0) + +Start-Sleep -s 5 +Start-Process notepad.exe