diff --git a/Get-PC.psd1 b/Get-PC.psd1 index 30ebe88..982b823 100644 --- a/Get-PC.psd1 +++ b/Get-PC.psd1 @@ -51,7 +51,7 @@ Copyright = '(c) 2019 Chuck Beddow. All rights reserved.' # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module -# RequiredModules = @() +RequiredModules = @('ConfigurationManager') # Assemblies that must be loaded prior to importing this module # RequiredAssemblies = @() diff --git a/Private/Invoke-Wake.ps1 b/Private/Invoke-Wake.ps1 new file mode 100644 index 0000000..0a618e9 --- /dev/null +++ b/Private/Invoke-Wake.ps1 @@ -0,0 +1,7 @@ +function Invoke-Wake($Computer) { + Write-Host "Attemping to wake up $Computer, check in a few minutes" + Push-Location + Set-Location "$(Get-PSDrive -PSProvider CMSite)`:" + Invoke-CMClientAction -DeviceName $Computer -ActionType ClientNotificationWakeUpClientNow + Pop-Location +} \ No newline at end of file diff --git a/Private/NextPrinterName.ps1 b/Private/NextPrinterName.ps1 index bd5b937..d1125e2 100644 --- a/Private/NextPrinterName.ps1 +++ b/Private/NextPrinterName.ps1 @@ -24,7 +24,7 @@ $printerHost = "$printerName$domain" #Write-Host $printerHost $testHost = Resolve-DnsName $printerHost - if($testHost -ne $null) { + if($null -ne $testHost) { $hit = $true } } diff --git a/Private/SHSUser.ps1 b/Private/SHSUser.ps1 index b49947b..cbc8ca0 100644 --- a/Private/SHSUser.ps1 +++ b/Private/SHSUser.ps1 @@ -30,6 +30,7 @@ Phone=$null Email=$null Computers=$null + LastLogon=$null } $obj = New-Object -TypeName PSObject -Property $props @@ -57,7 +58,7 @@ Phone=$UserInfo.telephoneNumber Email=$UserInfo.EmailAddress Computers=$computerList - + LastLogon=$UserInfo.LastLogonDate } $obj = New-Object -TypeName PSObject -Property $props diff --git a/Public/Get-PC.ps1 b/Public/Get-PC.ps1 index 797c6fc..4785ce8 100644 --- a/Public/Get-PC.ps1 +++ b/Public/Get-PC.ps1 @@ -54,6 +54,7 @@ Function Get-PC { -RemoteDesktopApp | remote into computer using RDP -RequestLauncher | starts request launcher -ResetRepository | remotely resets repository + -Resources | more details about system resources -SCCM | queries sccm for the computer information -SHSPrinter | pulls data about a printer using snmp -SHSPrinterweb | pulls data about a printer and opens web interface and orion @@ -62,6 +63,7 @@ Function Get-PC { -Usb | shows installed usb devices -UserProfileBackup | backups and restores user profiles -ViewerRemote | remote into the computer using RemoteViewer + -Wake | attempts to wake on LAN -WinProfileRebuild | rebuilds user profiles For more detailed help please see the documentation on AppDoc @@ -110,6 +112,7 @@ Function Get-PC { [switch]$Usb, [Switch]$UserProfileBackup, [Switch]$ViewerRemote, + [Switch]$Wake, [Switch]$WinProfileRebuild ) @@ -300,6 +303,11 @@ Function Get-PC { Find-NextPrinterName $comp break } + + if ($Wake) { + Invoke-Wake $comp + continue + } #PING HERE - All commands after here either require the computer to be online or need to know #------------------------------------------------------------------------------------------------------------------------------------------------------------------#