Compare commits
9 Commits
Add_licens
...
efrick-pat
| Author | SHA1 | Date | |
|---|---|---|---|
| 150687f2a1 | |||
| 3f805bead7 | |||
| dbe2543217 | |||
| 9170d37d0c | |||
| bf11d64feb | |||
| 4ff0c92217 | |||
| 93b2bf9180 | |||
| 9c16227e91 | |||
| 9161568787 |
27
README.md
27
README.md
@@ -24,6 +24,18 @@ It currently outputs:
|
|||||||
|
|
||||||
## Quick Run
|
## Quick Run
|
||||||
|
|
||||||
|
### From USB Stick
|
||||||
|
|
||||||
|
Download the USB_Run.zip latest release from [Releases](https://efrick.ddns.net/git/efrick/Sysinfo/releases).
|
||||||
|
|
||||||
|
Unzip and copy the folder to a USB stick.
|
||||||
|
|
||||||
|
Click on the file `quickrun.bat`
|
||||||
|
|
||||||
|
This will put the output file into the directory it was run from.
|
||||||
|
|
||||||
|
### From Web
|
||||||
|
|
||||||
Copy and past into `CMD`
|
Copy and past into `CMD`
|
||||||
|
|
||||||
**[Note:]** must be run from an admin prompt.
|
**[Note:]** must be run from an admin prompt.
|
||||||
@@ -36,11 +48,12 @@ Powershell.exe -command "$current_execution_policy = Get-ExecutionPolicy; Set-Ex
|
|||||||
|
|
||||||
This copies the bat file to a temporary location and runs it with the command switch to write the results to the desktop.
|
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
|
#### Powershell Breakout
|
||||||
Below is a breakout of the Powershell commands run by the Quickrun above.
|
Below is a breakout of the Powershell commands run by the Quickrun above.
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
$current_execution_policy = Get-ExecutionPolicy; Set-ExecutionPolicy Bypass CurrentUser
|
$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")
|
(New-Object System.Net.WebClient).DownloadFile("https://efrick.ddns.net/git/efrick/Sysinfo/raw/branch/master/sysinfo.ps1", "sysinfo.ps1")
|
||||||
.\sysinfo.ps1 -write_output
|
.\sysinfo.ps1 -write_output
|
||||||
rm .\sysinfo.ps1
|
rm .\sysinfo.ps1
|
||||||
@@ -78,4 +91,12 @@ It will require the ability to run Powershell Scripts which is restricted by def
|
|||||||
|
|
||||||
## Dev Notes
|
## Dev Notes
|
||||||
|
|
||||||
Going forward branch master will be write protected. Please do all further work on branches off of master.
|
Going forward branch master will be write protected. Please do all further work on branches off of master.
|
||||||
|
|
||||||
|
I will be starting to work on rewriting the main script in C#. This will afford the following advangages:
|
||||||
|
|
||||||
|
* An executable. This will have the advange of not having to mess with the Powershell ExecutionPolicy everytime you want to run the scritp.
|
||||||
|
|
||||||
|
* The Autorun in the USB_Run.zip file will actually be able to launch the script.
|
||||||
|
|
||||||
|
* With it being writin in C# it should be more extensable and somewhat easier to manintain.
|
||||||
@@ -2,8 +2,5 @@ ECHO off
|
|||||||
REM Runs the quick run commands form the readme.md
|
REM Runs the quick run commands form the readme.md
|
||||||
REM https://efrick.ddns.net/git/efrick/Sysinfo/src/branch/master/README.md#quick-run
|
REM https://efrick.ddns.net/git/efrick/Sysinfo/src/branch/master/README.md#quick-run
|
||||||
REM This must be run from an elevated prompt.
|
REM This must be run from an elevated prompt.
|
||||||
curl https://efrick.ddns.net/git/efrick/Sysinfo/raw/branch/master/sysinfo.ps1 > %userprofile%\AppData\Local\Temp\sysinfo.ps1;
|
|
||||||
|
|
||||||
Powershell.exe -command "cd $env:userprofile; AppData\Local\Temp\sysinfo.ps1 -write_output"
|
Powershell.exe -command "$current_execution_policy = Get-ExecutionPolicy; Set-ExecutionPolicy Bypass CurrentUser;$current_path = pwd; .\sysinfo.ps1 -write_output -file_location $current_path.Path;Set-ExecutionPolicy $current_execution_policy CurrentUser"
|
||||||
|
|
||||||
del %userprofile%\AppData\Local\Temp\sysinfo.ps1
|
|
||||||
|
|||||||
@@ -40,8 +40,7 @@ function Find-RAM { #This finds the systems total physical memory and then retur
|
|||||||
|
|
||||||
$system_memory = $cs.totalphysicalmemory
|
$system_memory = $cs.totalphysicalmemory
|
||||||
|
|
||||||
$system_memory = $system_memory * 0.000000001 #Multiplies by 0.000000001 as the number give by CIM is in bytes.
|
$system_memory = [math]::Round($system_memory / 1GB, 2)
|
||||||
$system_memory = [math]::floor($system_memory)
|
|
||||||
$system_memory = [String]$system_memory + " GB"
|
$system_memory = [String]$system_memory + " GB"
|
||||||
|
|
||||||
return $system_memory
|
return $system_memory
|
||||||
@@ -57,6 +56,7 @@ function Find-Computer-Info {
|
|||||||
|
|
||||||
#Init array for storing computer's data
|
#Init array for storing computer's data
|
||||||
$computer_info = @("HOSTNAME:", $cs.Name,
|
$computer_info = @("HOSTNAME:", $cs.Name,
|
||||||
|
"Domain:", $cs.Domain,
|
||||||
"OS Version:", $computer_os_info.Caption,
|
"OS Version:", $computer_os_info.Caption,
|
||||||
"OS Architecture:", $computer_os_info.OSArchitecture,
|
"OS Architecture:", $computer_os_info.OSArchitecture,
|
||||||
"Manufacture:", $cs.manufacturer,
|
"Manufacture:", $cs.manufacturer,
|
||||||
@@ -94,6 +94,7 @@ function Show-Computer-Info { # Function writes by default to stdout. If given a
|
|||||||
|
|
||||||
function Find-Computer-Info_7 {
|
function Find-Computer-Info_7 {
|
||||||
$cs_hostname = wmic computersystem get name
|
$cs_hostname = wmic computersystem get name
|
||||||
|
$cs_domain = wmic computersystem get Domain
|
||||||
$os_name = wmic os get Caption
|
$os_name = wmic os get Caption
|
||||||
$os_arch = wmic computersystem get SystemType
|
$os_arch = wmic computersystem get SystemType
|
||||||
$cpu_name = wmic cpu get name
|
$cpu_name = wmic cpu get name
|
||||||
@@ -105,6 +106,7 @@ function Find-Computer-Info_7 {
|
|||||||
|
|
||||||
$computer_info_7 = @(
|
$computer_info_7 = @(
|
||||||
"HOSTNAME:", $cs_hostname[2],
|
"HOSTNAME:", $cs_hostname[2],
|
||||||
|
"Domain:", $cs_domain[2],
|
||||||
"OS Version:", $os_name[2],
|
"OS Version:", $os_name[2],
|
||||||
"OS Architecture:", $os_arch[2],
|
"OS Architecture:", $os_arch[2],
|
||||||
"Manufacture:", $cs_manufacturer[2],
|
"Manufacture:", $cs_manufacturer[2],
|
||||||
|
|||||||
Reference in New Issue
Block a user