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 | |
| 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
| 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
| 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
| <# | |
| .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 |
OlderNewer