This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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]@{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .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>. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .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 |
NewerOlder