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 Watch-UBreakIFix ($TrackingCode) { | |
while ($true) { | |
$result = foreach ($code in $TrackingCode) { | |
$response = Invoke-RestMethod "https://www.ubreakifix.com/api/v1/tracker/info?code=$code" | |
$status = $response.work_orders.work_order_status | |
[PSCustomObject]@{ | |
'Customer' = $response.customer.full_name | |
'Device' = $response.work_orders.device.device_type.name | |
'Fixer' = $response.user.email | |
'Status' = $status.name |
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
#requires -Module Az.Accounts | |
$verbosePreference = 'continue' | |
function ConvertFrom-JWTtoken { | |
<# | |
.NOTES | |
Lovingly borrowed from: https://www.michev.info/blog/post/2140/decode-jwt-access-and-id-tokens-via-powershell | |
#> | |
[cmdletbinding()] | |
param([Parameter(Mandatory = $true)][string]$token) | |
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
#requires -module Az.Functions | |
function Write-CmdletError { | |
param($message, $cmdlet = $PSCmdlet) | |
$cmdlet.ThrowTerminatingError( | |
[Management.Automation.ErrorRecord]::new( | |
$message, | |
'CmdletError', | |
'InvalidArgument', |
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
using namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Models | |
using namespace System.Management.Automation | |
function New-JAzDataCollectionRule { | |
<# | |
.SYNOPSIS | |
Create a new Data Collection Rule in Azure Monitor. Uses 2023 API for direct DCRs | |
.NOTES | |
The MS Documentation on this sucks but the reference has a good example which is how I figured it out: https://learn.microsoft.com/en-us/rest/api/monitor/data-collection-rules/create?view=rest-monitor-2023-03-11&tabs=HTTP#create-or-update-data-collection-rule-with-embedded-ingestion-endpoints | |
#> |
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
#Requires -Version 5.1 -RunAsAdministrator | |
using namespace System.IO | |
using namespace System.Net | |
#NOTE: The core code flow in is in the Main region at the bottom of the script. | |
<# | |
.SYNOPSIS | |
This is a script that unifies the Azure Arc and AKS Edge Essentials installation process. You can use this script to connect a server to Azure Arc as well as AKS Edge Essentials. | |
#> |
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
#requires -version 7 | |
using namespace Microsoft.PowerShell.Commands | |
using namespace System.Text | |
$ErrorActionPreference = 'Stop' | |
#Suppress useless IRM Verbose output | |
$PSDefaultParameterValues['Invoke-RestMethod:Verbose'] = $false | |
$PSDefaultParameterValues['Invoke-WebRequest:Verbose'] = $false | |
$DebugPreference = 'SilentlyContinue' |
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
#requires -module PowerAlto, ImportExcel | |
$ErrorActionPreference = 'Stop' | |
if (-not $MacVendorCache) { | |
Write-Warning 'MacVendorCache not found, downloading from maclookup.app. This is common on the first run.' | |
$SCRIPT:MacVendorCache = @{} | |
foreach ($entry in $(ConvertFrom-Csv (Invoke-RestMethod 'https://maclookup.app/downloads/csv-database/get-db'))) { | |
$MacVendorCache[$entry.'Mac Prefix'] = $entry.'Vendor Name' | |
} | |
} |
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
using namespace System.Collections.Generic | |
function Get-OpenApiDefinition { | |
<# | |
Fetches the OpenAPI definition from the specified URI and for every ref, downloads the relative file to the destination folder. Currently only works with relative refs | |
#> | |
param ( | |
#The source | |
[Parameter(Mandatory)] | |
[Uri]$Uri, |
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
var _pageData = "[[1,null,null,null,null,null,null,null,null,null,\"at\",\"AAX3J7BhCRC7IVYMba1r7wDXuj920s9Frw:1706679164531\",\"10080040042915956860\",1706679164532,\"0\",\"en\",false,[null,null,\"[email protected]\",\"https://lh4.googleusercontent.com/-R4mL1JYgKEs/AAAAAAAAAAI/AAAAAAAAAAA/-74UcaDbnzk/s32-c/photo.jpg\",\"https://plus.google.com/100005784601014694175/about\",\"Justin Grote\",\"https://lh4.googleusercontent.com/-R4mL1JYgKEs/AAAAAAAAAAI/AAAAAAAAAAA/-74UcaDbnzk/s64-c/photo.jpg\",\"https://lh3.googleusercontent.com/c5dqxl-2uHZ82ah9p7yxrVF1ZssrJNSV_15Nu0TUZwzCWqmtoLxCUJgEzLGtxsrJ6-v6R6rKU_-FYm881TTiMCJ_\\u003ds1600\"],\"https://www.google.com/maps/d/viewer?mid\\u003d1ydRiXegNnQcXEw-KLmsldBty7_xmedM\",\"https://www.google.com/maps/d/embed?mid\\u003d1ydRiXegNnQcXEw-KLmsldBty7_xmedM\\u0026ehbc\\u003d2E312F\",\"https://www.google.com/maps/d/edit?mid\\u003d1ydRiXegNnQcXEw-KLmsldBty7_xmedM\",\"https://www.google.com/maps/d/thumbnail?mid\\u003d1ydRiXegNnQcXEw-KLmsldBty7_xmedM\",null,null,true,\"https:/ |
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
using namespace System.Collections.Generic | |
using namespace Microsoft.PowerShell.Commands.Internal.Format | |
#Inspired by: https://gist.github.com/aaroncalderon/09a2833831c0f3a3bb57fe2224963942 | |
<# | |
.Synopsis | |
Converts PowerShell Objects or Format-Table output to Markdown | |
#> | |
Function ConvertTo-Markdown { | |
[CmdletBinding()] |