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
Get-AzIntegrationAccount | Select-Object Name, Location, @{Name = "Sku"; Expression = {$_.Sku.Name}}, @{Name = "Subscription"; Expression = {$_.Id.ToString().Split('/')[2]}} |
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
//If you are a guest in a customer AAD, and need to access data on their sub: | |
//[CustomerAADName] = contoso.com | |
strcat("https://portal.azure.com/[CustomerAADName]/#blade/Microsoft_Azure_EMA/LogicAppsMonitorBlade/runid/", url_encode(replace(@'/ACTIONS/.+',@'',ResourceId))) | |
//If your account is user account in the AAD | |
strcat("https://portal.azure.com/#blade/Microsoft_Azure_EMA/LogicAppsMonitorBlade/runid/", url_encode(replace(@'/ACTIONS/.+',@'',ResourceId))) | |
//The above example if based on failed actions, because we want to know the action in our overview, but then be able to click on the link to open the entire logic app run in a new tab, and don't have to "guess where the last error" failed, we know that from the overview. That also explains why we do a replace on /Actions/. This might NOT be needed in your example. | |
//The real trick is to encode the part of the "/subscriptions/...", containing the subscriptionid, resource groups name, logic app name and the runid. |
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
<# | |
You need to read this docs page: https://docs.microsoft.com/en-us/azure/automation/automation-update-azure-modules | |
Download the mentioned file from the github repo: https://github.com/Microsoft/AzureAutomation-Account-Modules-Update | |
You need to start a new PowerShell session, without profile | |
from cmd you can run: | |
powershell.exe -nologo -noprofile | |
#> | |
$PSModuleAutoloadingPreference = "none" |
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
Add-Type -AssemblyName System.Web | |
Add-Type -AssemblyName System.Net.Http | |
$ENV:PATH="$ENV:PATH;C:\Temp\d365fo.tools\nuget" | |
#requires -version 5 | |
<# | |
.SYNOPSIS | |
High Performance Powershell Module Installation | |
.DESCRIPTION | |
This is a proof of concept for using the Powershell Gallery OData API and HTTPClient to parallel install packages |
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
# Download latest dotnet/codeformatter release from github | |
$repo = "jgm/pandoc" | |
$filenamePattern = "*x86_64.zip" | |
$pathExtract = "C:\Tools\pandoc" | |
$innerDirectory = $true | |
$preRelease = $false | |
if ($preRelease) { | |
$releasesUri = "https://api.github.com/repos/$repo/releases" |
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
<# | |
Invoke-Pester -Path "C:\GIT\GITHUB\d365fo.tools.Workspace\Test-ParametersInExamples.ps1" -OutputFile 'C:\Temp\d365fo.tools_pester_results.xml' -OutputFormat NUnitXml | |
C:\GIT\GITHUB\dbatools.Workspace\ReportUnit.exe "C:\Temp\d365fo.tools_pester_results.xml" "C:\Temp\PesterReport-d365fo.tools.html" | |
Start-Process "C:\Temp\PesterReport-d365fo.tools.html" | |
#> | |
$moduleName = "d365fo.tools" | |
$path = "C:\GIT\GITHUB\$moduleName.Workspace\$moduleName\$moduleName" | |
Import-Module $path -Force |
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
# Hack to ignore versioning of the dll file and folder structure | |
$folderName = (Get-ChildItem -Path "C:\Program Files\WindowsPowerShell\Modules\AzureAD\2.0.*\Microsoft.IdentityModel.Clients.ActiveDirectory.dll").Directory.Name | Sort-Object -Descending | Select-Object -First 1 | |
# ADAL Helper Lib | |
Add-Type -Path "c:\Program Files\WindowsPowerShell\Modules\AzureAD\$folderName\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" | |
# Azure tenant | |
$tenant = "" | |
# Application ID for Powershell client | |
$client_Id = "1950a258-227b-4e31-a9cf-717495945fc2" | |
# Login 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
function Convert-HashTableToString { | |
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidDefaultValueSwitchParameter", "")] | |
[CmdletBinding()] | |
[OutputType([System.String])] | |
param ( | |
[HashTable] $InputObject, | |
[string] $KeyPrefix = "", | |
[string] $ValuePrefix = " = ", |
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
Register-PackageSource nugetV2 https://www.nuget.org/api/v2 -ProviderName NuGet -Trusted |
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
[Reflection.Assembly]$ass = [Reflection.Assembly]::LoadFile("C:\Temp\File.dll") | |
$specificType = $ass.GetType("Namespace.Type") | |
$specificType.GetMethods([System.Reflection.BindingFlags]::NonPublic -bor [System.Reflection.BindingFlags]::Instance) | |
$instanceTypeObj = [System.Activator]::CreateInstance("Namespace.Type") | |
$nameOfMethod = $specificType.GetMethod("NameOfMethod", [System.Reflection.BindingFlags]::NonPublic -bor [System.Reflection.BindingFlags]::Instance) |
NewerOlder