Provides an easy way to place a message on a service bus queue. It also has the code to create the azure infrastructure needed Instructions can be found here: https://medium.com/@byronbayer/calling-azure-service-bus-from-powershell-with-sas-authentication-token-eabf828398c8
Gets the API versions used with ARM templates in a structured tree. You can choose to include or exclude locations and versions
Get-AzApiVersions -IncludeVersions $true -IncludeLocations $false
Registers resource providers in the passed in array if the provider is not registered already.
get a list of resources available by calling (Get-AzResourceProvider).ProviderNamespace
$resourceProviders = @("microsoft.documentdb", "microsoft.insights", "microsoft.servicebus", "microsoft.sql", "microsoft.storage", "microsoft.web", "Microsoft.DataFactory", "Microsoft.AAD");
Register-ResourceProviders -resourceProviders $resourceProviders
Removes resource group deployments which are greater than the date specified. Specfying 0 days will delete all resource group deployments. ShowOnlyCounts parameter will only show the amount of deployments per resource group and not delete and deployments
$Days = 30
Remove-OldDeployments -Days $Days -ShowOnlyCounts $true -WhatIf
Removes the App registrations from within AAD apps list. This is very handy when you are using CI/CD to deploy your apps or apis that use AAD authenticated and the apps need to be removed from AAD and re-added registered.
$AppRegistrations = "*api1", "webapp*", "anotherapp"
$AadUsername = "AadUsername"
$AadPassword = ConvertTo-SecureString 'AadPassword' -AsPlainText -Force
$TenantId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
Remove-AppRegistrationsWithPattern -AppRegistrations $AppRegistrations -AadUsername $AadUsername -AadPassword $AadPassword -TenantId $TenantId
Will delete any files that are defined in the include and will not delete any files in the exclude. Either fill the include or the exclude, but not both. Exclude takes presedence. This is great for cleaning up a development directory
$include = @("*ncrunch*", "*.suo", "*.user", "*.userosscache", "*.sln.docstates", "*ncrunch*", ".vs", "bin", "obj", "build")
$exclude = @()
Remove-DefinedFilesFolderLocation -FolderLocation "C:\Dev\" -Include $include -Exclude $exclude -WhatIf
Removes any disks in the list passed in
$DisksToDelete = (Get-AzDisk | Where-Object DiskState -EQ 'Unattached').Name
#Or you could do the following
$DisksToDelete = "disk1", "disk2", "disk3"
Remove-Disks -DisksToDelete $DisksToDelete
Removes any NIC in the list passed in
$NICsToDelete = "nic1", "nic2", "nic3"
Remove-Nics -NICsToDelete $NICsToDelete
Deletes all resoure groups specified in the input array and stops any resources that are in the resource groups such as Azure Data Factory. A confirmation confirm the resource groups you are deleting first before any resource group is deleted
#Create some resouce groups
for ($i = 1; $i -lt 10; $i++) {
New-AzResourceGroup -Name "my-rg-00$i" -Location 'UK South' -Confirm:$false -Force | Out-Null
New-AzResourceGroup -Name "test-rg-00$i" -Location 'UK South' -Confirm:$false -Force | Out-Null
}
$ResourceGroupNamePatterns = "my*", "test*"
Remove-ResourcegroupsAsync -ResourceGroupNames $ResourceGroupNamePatterns
Changes the scale and location of an Sql Server Integration Service Integration runtime instance.
Update-SSISIR -subscription $subscription -resourceGroupName -nodeSize $nodeSize -location $location
Shuts all the VMs down in a subscription
Stop-Machines
Starts certain VMs in a paticular order either starting up all together or preserving the startup order in the array passed in.
$MachineNames = "jf-vm-002", "jf-vm-001"
Start-Machines -MachineNames $MachineNames -PreserveOrder $true
Replaces the AzureRm powershell modules with the new Az modules. Moreinformation can be found here https://docs.microsoft.com/en-us/powershell/azure/new-azureps-module-az?view=azps-2.6.0
Switch-AzureRmWithAz
Will get all the tags on resouces within a resource group and apply them to the Resouce group where the resource group has no tags
Add-TagsToResourceGroupFromResources
Will apply tags to resources from the parent resource group.
Add-TagsToResourcesFromResourceGroups
Writes out messages with colour coded times and message
$stopwatch = [system.diagnostics.stopwatch]::StartNew()
Write-Message -stopwatch $stopwatch -message 'Testing the message'
'Doing other stuff'
Start-Sleep -Seconds 5
'Doing more stuff'
Write-Message -stopwatch $stopwatch -message 'Bit later on'
Write-Message -message "Some other stuff"