Skip to content

Instantly share code, notes, and snippets.

@MatthewJDavis
Created July 15, 2017 16:09
Show Gist options
  • Save MatthewJDavis/da273783cb85c15fa6975c173e1ec7d3 to your computer and use it in GitHub Desktop.
Save MatthewJDavis/da273783cb85c15fa6975c173e1ec7d3 to your computer and use it in GitHub Desktop.
$majorVersion = $Host.Version.Major.ToString()
$minorVersion = $Host.Version.Minor.ToString()
$version = "$majorVersion.$minorVersion"
#module Imports
Import-Module azureext
Import-Module AWSPowerShell
#aliases
New-Alias -Name sub -Value Select-AzureRmSubscription
New-Alias -Name add -Value Add-AzureRmAccount
Set-Location -Path C:\git
Write-Output "PowerShell version" $version
Get-Date
function Prompt {
$location = Get-Location
$identity = [Security.Principal.WindowsIdentity]::GetCurrent()
$principal = [Security.Principal.WindowsPrincipal] $identity
if ($principal.IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
$Host.UI.RawUI.WindowTitle = "[ADMIN]: " + $location
} else {
$Host.UI.RawUI.WindowTitle = $location
}
"PS " + $env:username + "~" + (Get-Date -format t) + "> "
}#prompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment