This file contains 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
# V2 APIs | |
# Basic AuthN | |
$userID = 'yourWordpressAccountAlias' | |
$userPassword = 'ABCD wTUZ pIST 9jEo 99LV 1234' | |
$Bytes = [System.Text.Encoding]::utf8.GetBytes("$($userID):$($userPassword)") | |
$encodedAuth = [Convert]::ToBase64String($Bytes) | |
$header = @{Authorization = "Basic $($encodedAuth)" } | |
Invoke-RestMethod -method get -uri "https://yourwordpressURL/wp-json/wp/v2/posts" -headers $header |
This file contains 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-module PKCE | |
import-module JWTDetails | |
$clientID = '<your AAD clientID>' | |
$tenantID = '<your AAD tenantID' | |
$clientSecret = '<your AAD App Client Secret>' | |
$replyURL = 'https://localhost/' | |
$scopes = 'user.read.all' | |
Function Get-AuthCode { |
This file contains 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
# Get Service Principals | |
$spList = az ad sp list --all | |
$spListObj = $spList | ConvertFrom-Json | |
# Get Graph Permissions | |
$graphSP = $spListObj | Where-Object {$_.appID -eq '00000003-0000-0000-c000-000000000000'} | Select-Object | |
# List of Application Scopes | |
$adminScopes = $graphSP.oauth2Permissions | Where-Object {$_.type -eq 'Admin'} | Sort-Object value | Select-Object id, isEnabled, type, adminConsentDescription, adminConsentDisplayName, value |
This file contains 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 AuthN { | |
<# | |
.SYNOPSIS | |
Authenticate to Azure AD and receieve Access and Refresh Tokens. | |
.DESCRIPTION | |
Authenticate to Azure AD and receieve Access and Refresh Tokens. | |
.PARAMETER tenantID | |
(required) Azure AD TenantID. |
This file contains 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
#Install-Module MSAL.PS | |
Import-Module MSAL.PS | |
$resource = "https://graph.windows.net" # AzureAD Graph | |
$apiVersion = "api-version=1.6-internal" # Internal API | |
$scope = "user_impersonation" # Delegated User Impersonation | |
$clientID = "1b730954-1685-4b74-9bfd-dac224a7b894" # PowerShell | |
$tenantID = "yourcompanyAADName.com" # AAD | |
$myUPN = "useruserUPN@yourcompanyAADName.com" # User UPN |
This file contains 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
# list ISE Vertical AddOn Tools | |
$psISE.CurrentPowerShellTab.VerticalAddOnTools | |
# Add on name from the list retreived above | |
$addOnName = 'PowerGist' | |
# Check you've spelled it right and remove | |
$exists = $psISE.CurrentPowerShellTab.VerticalAddOnTools | where { $_.Name -eq $addOnName } | |
if ($exists) { | |
$psISE.CurrentPowerShellTab.VerticalAddOnTools.Remove($exists) |
This file contains 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
# Insert Test-Port Function here from https://gallery.technet.microsoft.com/scriptcenter/97119ed6-6fb2-446d-98d8-32d823867131 | |
# UDP Ports to probe | |
$udpports = @() | |
$udpports += "464" #Kerberos | |
$udpports += "3268" #GC | |
$udpports += "3269" #GC | |
# TCP Ports to probe | |
$ports = @() |
This file contains 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 AuthN { | |
<# | |
.SYNOPSIS | |
Authenticate to Azure AD and receieve Access and Refresh Tokens. | |
.DESCRIPTION | |
Authenticate to Azure AD and receieve Access and Refresh Tokens. | |
.PARAMETER tenantID | |
(required) Azure AD TenantID. |
This file contains 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 msal | |
import jwt | |
import json | |
import sys | |
import requests | |
from datetime import datetime | |
from msal_extensions import * | |
# Microsoft Azure PowerShell Client ID | |
clientID = '1950a258-227b-4e31-a9cf-717495945fc2' |
This file contains 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
# Audio Phrase | |
$audiofile = Get-ChildItem "C:\temp\speech2convert.wav" | |
# Read audio into byte array | |
$audioBytes = [System.IO.File]::ReadAllBytes($audiofile) | |
# API Key | |
$key1 = "your api key" | |
# Conversion URI | |
$conversionURI = "https://speech.platform.bing.com/speech/recognition/interactive/cognitiveservices/v1?language=en-us&format=detailed" | |
# Conversion Headers | |
$Headers = @{ |