Skip to content

Instantly share code, notes, and snippets.

View ahpooch's full-sized avatar
👖
Buzy wearing pants.

ahpooch ahpooch

👖
Buzy wearing pants.
View GitHub Profile
function Get-xCMObjectLocation {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[string] $InstanceKey,
[Parameter(Mandatory = $false)]
[string] $SiteCode = (Get-CMSite).SiteCode,
[Parameter(Mandatory = $false)]
[string] $SiteServer = ((Get-CMSiteSystemServer -SiteCode $SiteCode | Where-Object { $_.Type -eq "2" }) | Select-Object -ExpandProperty NetworkOSPath).TrimStart("\")
)
@ahpooch
ahpooch / imab.dk.windows11ToastNotificationScript_ConfigurationItem.ps1
Last active June 26, 2025 07:28
This script is meant to be a Discovery Script in Configuration Item of SCCM Baseline that preparing files and scheduled tasks for ToastNotificationScript company workflow
<#
.DESCRIPTION
This script is meant to be a Discovery Script in Configuration Item of SCCM Baseline that
preparing files and scheduled tasks for ToastNotificationScript company workflow
.LINK https://www.imab.dk/windows-10-toast-notification-script/
#>
### Setting variables
$CompanyName = "MyCompany"
$LocalScriptFilesPath = "C:\Windows\AdminScripts\ToastNotificationScript"
@ahpooch
ahpooch / Get-WiFi_Profiles.ps1
Created June 9, 2025 22:28
Snippet to get Wi-Fi Profiles in form of an array of PSCustomObjects.
$ProfilesRaw = netsh wlan show profiles
$results = $ProfilesRaw | Select-String '^ *(?<profilescope>.+): (?<profilename>.*)$' -AllMatches
$Profiles = @()
for ($i=0; $i -lt $results.count; $i++) {
$Profiles += [PSCustomObject]@{
Name = $results.Matches[$i].Groups['profilename'].Value
Scope = $results.Matches[$i].Groups['profilescope'].Value
}
}
############################################################################################
# Script to create wpad Site for Proxy #
### This script is written with idempotency in mind, so it can be run every time we want ###
# #
############################################################################################
# What the script does: #
# Creates directory for wpad site, sets basic NTFS Permissions, creates application pool, #
# creates site itself in IIS, configures mime types, disables caching, sets HostHeader and #
# log files path then starts web site. #
############################################################################################
@ahpooch
ahpooch / Jekyl on Ubuntu WSL2.md
Last active August 10, 2023 21:02
Install Jekyll on Ubuntu distributive in WSL2

Installing ruby, jekyll and bundler

sudo apt-get update -y && sudo apt-get upgrade -y
sudo apt-get install ruby-full
sudo apt-get install build-essential --no-install-recommends
sudo gem install jekyll bundler

Installing some other dependencies