From 42b781a560c32a6d7cb9fa1b8a3be11b852c33bb Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 8 Mar 2020 19:32:51 +0000 Subject: [PATCH] Update 'upd.ps1' --- upd.ps1 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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