Skip to content

Instantly share code, notes, and snippets.

@gwblok
gwblok / Get-HPCMSLVer.ps1
Created December 23, 2019 20:45
Check HPCMSL Version
#This will download the latest version of the HP Script Library, Install it and confirm it's installed.
#region: CMTraceLog Function formats logging in CMTrace style
function CMTraceLog {
[CmdletBinding()]
Param (
[Parameter(Mandatory=$false)]
$Message,
@gwblok
gwblok / RunScripts-GetCCMCacheInfo.ps1
Created December 19, 2019 21:35
RunScripts-GetCCMCacheInfo
#GARYTOWN - 2019.12.19 - @GWBLOK
#Connect to Cache
$CMObject = New-Object -ComObject 'UIResource.UIResourceMgr'
$CMCacheObjects = $CMObject.GetCacheInfo()
$CacheUsedStart = $CMCacheObjects.TotalSize - $CMCacheObjects.FreeSize
$CacheTotalSizeStart = $CMCacheObjects.TotalSize
$CMCacheObjectsElements = $CMCacheObjects.GetCacheElements()
$CacheCountStart = $CMCacheObjectsElements.Count
if ($CMCacheObjects.TotalSize -lt 25600)
@gwblok
gwblok / RunScripts-TriggerBaseline.ps1
Last active October 7, 2021 10:10
This will trigger the Configuration Baseline based on a parameter.
#For using in "Run Script" Node. Has Exit At end... will exit your ISE if you run in ISE. :-)
#Adopted from another script, so it has some Write-Hosts that don't really make sense in a CI, deal with it.
[CmdletBinding()]
Param (
[Parameter(Mandatory=$true)]
$BaselineName="WaaS Pre-Assessment"
)
@gwblok
gwblok / RunScripts-TriggerTS.ps1
Created October 25, 2019 19:28
This will Trigger a Task Sequence based on the Package ID
<#Triggers Task Sequence based on Package ID Parameter
@GWBLOK
Once Triggered, it will wait 2 minutes, then parse the execmgr log using a function from Jeff Scripter: ConvertFrom-Log
Once Parsed, looks for if the Task Sequence Successfully Started and reports back (Only if the Time Stamp for Starting is After the time you run the script)
#>
[CmdletBinding()]
Param (