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
# This script will add the Remove-Item alias:curl command to an existing PowerShell profile or create one if it does not exist | |
# If it is run from PowerShell ISE an ISE profile will be created: Microsoft.PowerShellISE_profile.ps1 | |
# Otherwise a regular profile will be created: Microsoft.PowerShell_profile.ps1 | |
$removeCurlAlias = @" | |
# Remove Alias curl -> Invoke-WebRequest | |
Remove-Item alias:curl | |
"@ | |
if (-Not (Test-Path $Profile)) |
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
Shortcut to command: | |
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -NoExit -Command "& { Write-Host "Hello"; Write-Host "World"}" | |
Shortcut to file: | |
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -NoExit -File %HOMEPATH%\MyScript.ps1 |
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
# Script to publish binary modules to Powershell Gallery based on Publish-ToPowerShellGallery.ps1 from https://github.com/mmaitre314/PowerShellGet-Test-Binary-Module | |
$manifestFilename = Get-ChildItem -Path $PSScriptRoot -Filter *.psd1 | Select-Object -First 1 -ExpandProperty Name | |
$manifestPath = Join-Path $PSScriptRoot $manifestFilename | |
$manifestData = Test-ModuleManifest -Path $manifestPath | |
Write-Host "Module version needs to be incremented before publishing. Current version is $($manifestData.Version)" | |
Update-ModuleManifest -Path $manifestPath -CmdletsToExport '*' -ModuleVersion (Read-Host "New module version: ") |
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
//Postman pre-request Script which generates a SAS token query string. | |
const storageSasKey = pm.variables.get("storageSasKey"); | |
const storageAccountName = pm.variables.get("storageAccountName"); | |
const storageSasTokenQueryString = createStorageSASTokenQueryString(storageAccountName, storageSasKey); | |
pm.variables.set("storageSasTokenQueryString", storageSasTokenQueryString); | |
/** |
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
Connect-AzureRmAccount | |
Set-AzureRmKeyVaultAccessPolicy -VaultName 'keyvaultname' -EnabledForTemplateDeployment |
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
$context = New-AzureRmApiManagementContext -resourcegroup 'ContosoResourceGroup' -servicename 'ContosoAPIMService' | |
Connect-AzureRmAccount | |
New-AzureRmApiManagementBackend -Context $context -Url 'https://backendurl' -Protocol http -SkipCertificateChainValidation $true | |
Get-AzureRmApiManagementBackend -Context $context | |
Remove-AzureRmApiManagementBackend -Context $context -BackendId 9e8e5a6ba56a4607af8e9dc4cc63fd92 |
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
/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation=$(Build.ArtifactStagingDirectory) /p:Configuration=Release |
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
Add-PSSnapin WDeploySnapin3.0 | |
$packagePath = $env:System_DefaultWorkingDirectory + '\_' + $env:Release_DefinitionName + '\drop\' + $env:Release_DefinitionName + '_BT_WCF.zip' | |
Restore-WDPackage -Package $packagePath -Parameters @{ "IIS Web Application Name"=$env:WebApplicationName } |
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
// Not empty or whitespace | |
^\S+$ |
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
^.{15,} |
OlderNewer