Skip to content

Instantly share code, notes, and snippets.

View scriptingstudio's full-sized avatar
👍
Awake and ready

Matthew Gray scriptingstudio

👍
Awake and ready
View GitHub Profile
@scriptingstudio
scriptingstudio / Get-CimClassMember.psm1
Last active December 4, 2026 10:38
GCCM - "get-member" for CIM/WMI classes
<#
.SYNOPSIS
GCCM - "get-member" for CIM/WMI classes.
.DESCRIPTION
Get information about CIM/WMI class members.
Key features:
- Get-Member output style for class summary (default mode)
- Method and property details
- Remote operations
- Listing of classes in the namespace selected
@scriptingstudio
scriptingstudio / Get-AppxProvisionedPackageOnline.ps1
Last active December 2, 2026 11:14
A simple work around that don't require admin privileges
function Get-AppxProvisionedPackageOnline ([string[]]$name) {
$sbstr = if ($name) {
($name | ForEach-Object {"`$_.PSChildName -like '$_'"}) -join ' -or '
} else {'$_'}
$filter = [scriptblock]::Create($sbstr)
Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Applications' |
Where-Object $filter | ForEach-Object {
$p = $_ | Get-ItemProperty
$displayName, $version, $arch, $resourceId, $pub = $_.PSChildName -split '_'
[PSCustomObject]@{
@scriptingstudio
scriptingstudio / get-localipaddress.ps1
Last active November 27, 2026 10:03
The fastest way to know your local IP address
function get-localipaddress ([switch]$ipV6, [switch]$all) {
if ($all) {
return (get-localipaddress),(get-localipaddress -ipV6)
}
if ($PSVersionTable.PSEdition -eq 'core') {
$p = if ($ipV6) {@{ipv6=$true}} else {@{ipv4=$true}}
(Test-Connection $env:computername -count 1 @p).DisplayAddress
} else {
$p = if ($ipV6) {'IPV6Address'} else {'IPV4Address'}
(Test-Connection $env:computername -count 1).$p.IPAddressToString
@scriptingstudio
scriptingstudio / msi-info.ps1
Created November 21, 2026 07:52
A simple way to get properties from MSI/MSP installers
<#
.SYNOPSIS
MSI/MSP properites
.LINK
https://learn.microsoft.com/en-us/windows/win32/msi/summary-property-descriptions
.NOTES
There are 2 ways to get properites from MSI/MSP installers:
- database
Cons: extremely slow
- SummaryInformation method
@scriptingstudio
scriptingstudio / getuseragent.ps1
Created November 16, 2026 16:59
A PowerShell script to fetch a list of the latest and most common useragents seen on the web across all device types, operating systems, and browsers
param (
[switch] $cache,
[switch] $latest
)
if ($cache -and $global:useragentcache) {
$response = $global:useragentcache
} else {
$response = Invoke-RestMethod https://www.useragents.me/api -UserAgent 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36' -TimeoutSec 18
if (-not $response) {
@scriptingstudio
scriptingstudio / ps7msi.ps1
Last active November 16, 2026 11:52
PowerShell 7.7 MSI savior - custom distro downloader/aggregator
<#
.SYNOPSIS
PowerShell 7.7 MSI distro downloader.
.DESCRIPTION
Microsoft deprecated MSI & EXE for version 7.7.
This is a PowerShell 7.7 MSI savior - custom distro downloader/aggregator.
.PARAMETER Path
Specifies a folder name for downloads. If omitted the current user's Downloads folder would be selected.
.PARAMETER Platform
Specifies an ID of the target asset. Valid values are x86, x64, arm64, *, %<regex>.
@scriptingstudio
scriptingstudio / ArtCraftStat.ps1
Last active October 25, 2026 08:15
ArtCraft Application Development Status demo (https://getartcraft.com/apps)
# Known issues: low GitHub API rate limit (60 requests / hour)
[CmdletBinding()]
param (
[parameter(Position=0)]
[string[]] $name,
[switch] $download, # experimental
[switch] $portable, # download option (Windows only)
#[ValidateSet('windows','linux','mac','warm','larm')]
#[string] $platform = 'windows', # experimental; windows,linux,mac...; download option
#[switch] $force, # download option
@scriptingstudio
scriptingstudio / New-Culture.ps1
Last active October 17, 2026 10:42
PowerShell culture selector
function New-Culture ([string]$name, [int]$lcid, [switch]$list) {
if ($list) {
return [cultureinfo]::GetCultures([System.Globalization.CultureTypes]::AllCultures)
}
if (-not $name -and $lcid -lt 1) {return Get-Culture}
if (-not $name) {$name = 'zzzzzzzzz'}
[cultureinfo]::GetCultures([System.Globalization.CultureTypes]::AllCultures) |
Where-Object {$_.name -eq $name -or $lcid -eq $_.lcid}
} # END New-Culture
@scriptingstudio
scriptingstudio / icoreader.py
Last active August 16, 2026 20:18
ICO reader in Python demo
import struct
import ctypes
import re
user32 = ctypes.WinDLL(r'C:\Windows\System32\user32.dll')
icofile = r'<filepath_to_your_icofile>' # set your file name!!!
print(icofile)
with open(icofile, 'rb') as f:
data = f.read()
@scriptingstudio
scriptingstudio / icoreader.ps1
Last active August 8, 2026 12:53
ICO Reader with export capability demo
<#
.SYNOPSIS
ICO file reader.
.DESCRIPTION
An AIO function to read and export icons stored within .ICO files. Read-Ico can export high-quality icons of all sizes, and all color formats to a number of formats, including ico, png, jpg, and gif.
Key features:
- Multisize high-quality ICO
- Ability to create a separate ICO for each size at once
- ICO integrity check
- Ability interactively select image file