From 61038d43e5ed706e66174f4337bbe4318d117f30 Mon Sep 17 00:00:00 2001 From: Zachary Gorman Date: Tue, 16 Jul 2024 08:51:00 -0700 Subject: [PATCH] Updated version number and added the flags to main get-pc --- Get-PC.psd1 | 2 +- Private/UninstallProgram.ps1 | 2 +- Public/Get-PC.ps1 | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Get-PC.psd1 b/Get-PC.psd1 index 1663b84..2c17342 100644 --- a/Get-PC.psd1 +++ b/Get-PC.psd1 @@ -12,7 +12,7 @@ RootModule = 'Get-PC.psm1' # Version number of this module. -ModuleVersion = '0.3.14' +ModuleVersion = '0.3.15' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/Private/UninstallProgram.ps1 b/Private/UninstallProgram.ps1 index 0cf92eb..127e998 100644 --- a/Private/UninstallProgram.ps1 +++ b/Private/UninstallProgram.ps1 @@ -18,7 +18,7 @@ function Invoke-UninstallProgram ($Computer) { foreach ($item in $selection) { Write-Host "[$item] $($apps[$item].Name)" } - $res = Read-Host "Are you sure you want to delete this/these app(s)?" + $res = Read-Host "Are you sure you want to delete this/these app(s)? (y/N)" if (-not ($res -match "^[yY]")) { Write-Host -ForegroundColor Red "Uninstall Aborted" return diff --git a/Public/Get-PC.ps1 b/Public/Get-PC.ps1 index c2aa1ff..154f3cf 100644 --- a/Public/Get-PC.ps1 +++ b/Public/Get-PC.ps1 @@ -102,6 +102,7 @@ Function Get-PC { [Switch]$PCCleanup, [Switch]$PCReboot, [Switch]$PCRename, + [Switch]$Quiet, [Switch]$RemoteDesktopApp, [Switch]$RequestLauncher, [Switch]$Resources, @@ -112,6 +113,7 @@ Function Get-PC { [switch]$SHSPrinterWeb, [Switch]$SHSUser, [Switch]$TableView, + [Switch]$UninstallProgram, [switch]$Update, [switch]$Usb, [Switch]$UserProfileBackup, @@ -424,6 +426,11 @@ Function Get-PC { continue } + if ($UninstallProgram) { + Invoke-UninstallProgram $comp + break + } + if ($GPUpdate) { if ($compStatus -ne 'Online') { @@ -446,6 +453,17 @@ Function Get-PC { Get-Bypass $comp } + #Removes any indicator that another user is remoted onto their PC (like the green bar) + if ($Quiet) { + + if ($compStatus -ne 'Online') { + Write-Warning "$comp is $compStatus unable to proccess command" + break + } + + Invoke-Quiet $comp + } + #Runs Remote Viewer, Thick Client Only if ($ViewerRemote) {