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
# https://learn.microsoft.com/en-us/azure/app-service/deploy-ci-cd-custom-container?tabs=private&pivots=container-linux#4-enable-cicd | |
$WebhookURL = '' | |
$Username = $WebhookURL.Split('https://').Split(':')[1].Split('@')[0] | |
$Password = $WebhookURL.Split('https://').Split(':')[2].Split('@')[0] | |
$Headers = @{ 'Authorization' = "Basic $([Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("$Username`:$Password")))" } | |
Invoke-RestMethod -Method Post -Uri "https://$($WebhookURL.Split('@')[1])" -Headers $Headers -UserAgent 'powershell/1.0' |
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
from bs4 import BeautifulSoup | |
# path to the local file | |
doc = "C:\\Users\\Ryland\\Desktop\\index.html" | |
# open the file in read mode | |
with open(doc, 'r') as f: | |
content = f.read() | |
# Initialize the object with the document |
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
# Define variables | |
$ResourceGroupName = '' | |
$AppGatewayName = '' | |
$ManagedIdentityName = '' | |
$KeyVaultName = '' | |
$KeyVaultCertficateName = '' | |
# Get App Gateway and Managed Identity resource objects | |
$AppGateway = Get-AzApplicationGateway -Name $AppGatewayName -ResourceGroupName $ResourceGroupName | |
$ManagedIdentity = Get-AzUserAssignedIdentity -Name $ManagedIdentityName -ResourceGroupName $ResourceGroupName |
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
$SubscriptionId = '' | |
$ModelName = 'gpt-35-turbo*' | |
$RGs = Get-AzResourceGroup | |
foreach ($RG in $RGs) { | |
Write-Output "Processing Resource Group $($RG.ResourceGroupName)" | |
$Accounts = Get-AzCognitiveServicesAccount -ResourceGroupName $RG.ResourceGroupName | Where-Object { $_.Properties.Endpoint -like '*openai.azure.com*' } | Select-Object -ExpandProperty CustomSubDomainName | |
foreach ($Acct in $Accounts) { | |
Write-Output "Processing OpenAI Account $($Acct)" |
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
<# | |
.SYNOPSIS | |
This script will download all files from a specified SharePoint Document Library path. | |
.EXAMPLE | |
$ScriptParams = @{ | |
SharePointTenant = 'mycompany.sharepoint.com' | |
SiteName = 'mysite/my subsite' | |
DocumentLibraryName = 'Documents' | |
DocumentLibraryPath = 'my directory/my subdirectory' | |
LastModifiedDate = (Get-Date '2024-01-01') |
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 New-MasterKeyAuthorizationSignature { | |
<# | |
.SYNOPSIS | |
Generate Cosmos DB Master Key Authentication header for use with the NoSQL REST API. | |
.EXAMPLE | |
$AuthKeyParams = @{ | |
Method = Post | |
ResourceId = "dbs/$DatabaseId/colls/$CollectionId" | |
Date = [DateTime]::UtcNow.ToString('r') | |
MasterKey = $MasterKey |
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
$StorageAccount = '' | |
$Table = '' | |
$PartitionKey = '' | |
$RowKey = '' | |
# Set Azure Table Storage request headers | |
$Date = [DateTime]::UtcNow.ToString('R') | |
$AzTableHeaders = @{ | |
'Accept' = 'application/json;odata=nometadata' | |
'x-ms-version' = '2020-08-04' |
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 the Immutable ID of the ADDS user | |
$Name = 'My Name' | |
$ADUser = Get-ADUser -Filter 'Name -like "*$Name*"' | |
$ImmutableId = [System.Convert]::ToBase64String($ADUser.ObjectGUID.tobytearray()) | |
# Connect to Azure AD | |
Connect-AzureAD | |
# Remove the duplicated user from Azure AD that was created when the ADDS user was first synced | |
Remove-AzureADUser -ObjectId <duplicated AAD user ObjectId> |
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
#requires -Version 5.1 | |
# Install required module from PSGallery | |
Install-Module -Name Microsoft.Xrm.Tooling.CrmConnector.PowerShell | |
# Interactive Sign-in | |
$CRMConn = Get-CrmConnection -InteractiveMode | |
# Unattended Sign-in | |
$Cred = New-Object System.Management.Automation.PSCredential ($UserName, $(ConvertTo-SecureString -String $Password -AsPlainText -Force)) |
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
[Reflection.Assembly]::LoadWithPartialName('System.Web') | Out-Null | |
$HMAC = New-Object System.Security.Cryptography.HMACSHA256 | |
$EventHubsNamespace = '' | |
$EventHubName = '' | |
$EventHubEndpoint = "$EventHubsNamespace.servicebus.windows.net/$EventHubName" | |
$AccessPolicyName = 'RootManageSharedAccessKey' | |
$AccessPolicyKey = '' | |
$SASExpirationTime = ([DateTimeOffset]::Now.ToUnixTimeSeconds()) + 3000 |
NewerOlder