Skip to content

Instantly share code, notes, and snippets.

View marcoheijkoop's full-sized avatar

m@rco marcoheijkoop

View GitHub Profile
@alexverboon
alexverboon / Get-log4files.ps1
Created December 14, 2021 21:14
PowerShell script to find log4j-core.jar files
Function Get-log4files(){
$Drives = Get-PSDrive | Select-Object -ExpandProperty 'Name' | Select-String -Pattern '^[a-e]$'
$FileInfo = [System.Collections.ArrayList]::new()
$Filetypes = @("*.jar")
ForEach($DriveLetter in $Drives)
{
$Drive = "$DriveLetter" + ":\"
$Log4Files = Get-ChildItem -Path $Drive -Filter "*log4j-core*" -Include $Filetypes -Recurse -File -ErrorAction SilentlyContinue | Select-Object FullName
Foreach($file in $Log4Files)
{
@alexverboon
alexverboon / Export-CMScriptResults.ps1
Last active May 9, 2023 15:04
Export-CMScriptResults
Function Export-CMScriptResults
{
<#
.Synopsis
Export-CMScriptResults
.DESCRIPTION
Export-CMScriptResults exports the return values from scripts that are executed
through the ConfigMgr Run Script feature.
.PARAMETER ScriptName
The name of the Script as it is displayed within the ConfigMgr Console.