View Set-MyAzSub.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
function Set-MyAzSub { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory = $true, Position = 0)][string]$SubCode | |
) | |
$SubscriptionTable = @{ | |
'proj1-dev' = @{ | |
'SubscriptionName' = '' #Name of subscription Ex: 'Project1 - Development' | |
'SubscriptionId' = '' #Subscription ID(GUID) Ex: cb9ace2f-e5e1-42ba-afe2-b9a4d6126e01 |
View Get-PublicIPAddress.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
function Get-PublicIPAddress { | |
[CmdletBinding()] | |
$OriginalPref = $ProgressPreference # Default is 'Continue' | |
$ProgressPreference = "SilentlyContinue" | |
(Invoke-WebRequest -uri "http://ifconfig.me/ip").Content | |
$ProgressPreference = $OriginalPref |
View New-FeatureBranchName.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
function New-FeatureBranchName { | |
[CmdletBinding()] | |
param ( | |
# Work Item ID | |
[Parameter(Mandatory)][Alias('i','id')][string]$workItemId, | |
# Work Item Title | |
[Parameter(Mandatory)][Alias('t','title')][string]$workItemTitle, | |
# Initials | |
[Parameter()][Alias('in','name', 'inits')][string]$initials | |
) |
View howtofindyourprofile.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
> $profile | |
> C:\Users\Mert\Documents\PowerShell\Microsoft.PowerShell_profile.ps1 |
View profile.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
# Shows navigable menu of all options when hitting Tab | |
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete | |
# Autocompletion for arrow keys | |
Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward | |
Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward | |
#Custom functions location | |
$Path = "C:\Users\Mert\source\MertPSFunctions\" | |
Get-ChildItem -Path $Path -Filter *.ps1 |ForEach-Object { |
View set-azcontext-example.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
Set-AzContext -Subscription 'SUBSCRIPTION-NAME-OR-ID' -TenantId 'AZURE-AD-DIRECTORY-TENANT-ID' |
View set-myazsub-example.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
Set-MyAzSub 'proj1-dev' |
View New-FeatureBranchName-example.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
> New-FeatureBranchName -id 264 -title 'Create Azure VM via ARM Template' | |
feature/264_Create_Azure_VM_via_ARM_Template | |
#or with initials | |
> New-FeatureBranchName -id 264 -title 'Create Azure VM via ARM Template' -initials ms | |
feature/ms/264_Create_Azure_VM_via_ARM_Template |
View cli-tool-example.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
& myclitool login -url "URL" -username "USERNAME" -secret "PASSWORDorSECRET" |
View dbrclidemo.sh
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
#!/bin/bash | |
DatabricksUrl='https://#{AZURE-DATABRICKS-TENANT-URL}#' | |
dapiToken='#{AZURE-DATABRICKS-TENANT-DAPI-TOKEN}#' | |
databricks configure --token <<EOF | |
${DatabricksUrl} | |
${dapiToken} | |
EOF | |
echo -e "\nDatabricks workspace list:" | |
databricks workspace list |
OlderNewer