From a6550b4b16fa81bef4a4649442ea22b68ccec6a4 Mon Sep 17 00:00:00 2001 From: efrick Date: Wed, 28 Apr 2021 09:46:58 -0400 Subject: [PATCH] Update Quickrun Instructions The instructions have been wrapped into a single Powershell command. --- README.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 820b67a..a16bb71 100644 --- a/README.md +++ b/README.md @@ -27,18 +27,26 @@ It currently outputs: Copy and past into `CMD` **[Note:]** must be run from an admin prompt. +This command is broken out below. ```powershell -curl https://efrick.ddns.net/git/efrick/Sysinfo/raw/branch/master/sysinfo.ps1 > %userprofile%\AppData\Local\Temp\sysinfo.ps1; - -Powershell.exe -command "$current_execution_policy = Get-ExecutionPolicy; Set-ExecutionPolicy Bypass CurrentUser ;cd $env:userprofile; AppData\Local\Temp\sysinfo.ps1 -write_output; Set-ExecutionPolicy $current_execution_policy CurrentUser" - -del %userprofile%\AppData\Local\Temp\sysinfo.ps1 +Powershell.exe -command "$current_execution_policy = Get-ExecutionPolicy; Set-ExecutionPolicy Bypass CurrentUser; (New-Object System.Net.WebClient).DownloadFile('https://efrick.ddns.net/git/efrick/Sysinfo/raw/branch/master/sysinfo.ps1', 'sysinfo.ps1'); .\sysinfo.ps1 -write_output;rm .\sysinfo.ps1; Set-ExecutionPolicy $current_execution_policy CurrentUser" ``` This copies the bat file to a temporary location and runs it with the command switch to write the results to the desktop. +### Powershell Breakout +Below is a breakout of the Powershell commands run by the Quickrun above. + +```powershell +$current_execution_policy = Get-ExecutionPolicy; Set-ExecutionPolicy Bypass CurrentUser +(New-Object System.Net.WebClient).DownloadFile("https://efrick.ddns.net/git/efrick/Sysinfo/raw/branch/master/sysinfo.ps1", "sysinfo.ps1") +.\sysinfo.ps1 -write_output +rm .\sysinfo.ps1 +Set-ExecutionPolicy $current_execution_policy CurrentUser +``` + ## Command Switches The following can be selected at run-time.