From 8ac48f01fa6fef16eebf051bc363da38d9792620 Mon Sep 17 00:00:00 2001 From: Timur Date: Wed, 26 Jun 2024 07:38:51 +0000 Subject: [PATCH] Upload files to "Microsoft" --- Microsoft/Get_system_information.ps1 | 47 ++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Microsoft/Get_system_information.ps1 diff --git a/Microsoft/Get_system_information.ps1 b/Microsoft/Get_system_information.ps1 new file mode 100644 index 0000000..383dd46 --- /dev/null +++ b/Microsoft/Get_system_information.ps1 @@ -0,0 +1,47 @@ +# Script by Timur@0x01337.com +# Date: 2023-11-24 +<# +.DESCRIPTION +Displays the detailed information about the hardware and operating system. + +.PARAMETER help +Displays a detailed usage description of this script. + +.EXAMPLE +PS> .\Get-System-Information.ps1 + +.EXAMPLE +PS> .\Get-System-Information.ps1 -help +#> + +# Getting command line parameters +param ( + [parameter(Mandatory = $false)][switch]$help +) + +# Writing help message +if ($help) { + get-help $MyInvocation.MyCommand.Path -Full + exit 0 +} + +$command = "systeminfo" + +Write-Host "Running $command" +try { + $process = Start-Process -Wait -PassThru -NoNewWindow -FilePath $command +} +catch { + Write-Error "$_, exit code: $($process.ExitCode)" + exit 1 +} + +if (!$process -or $process.ExitCode -ne 0) { + Write-Error "$command failed, exit code: $($process.ExitCode)" + exit 1 +} + +Write-Host "$command finished, exit code: $($process.ExitCode)" +exit 0 + +