Last active
November 17, 2016 19:26
-
-
Save mirontoli/8471250 to your computer and use it in GitHub Desktop.
PowerShell Profile: ~\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1http://sharepoint.stackexchange.com/questions/15102/automatically-add-pssnapin-microsoft-sharepoint-powershell
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
if (!(Test-Path $profile)) { | |
New-Item $profile -Type File -Force | |
} |
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
#Clear-Host | |
#asnp *share* | |
function prompt { | |
Write-Host -NoNewLine -ForegroundColor White "[" | |
Write-Host ([Environment]::UserName + "@" + | |
[Environment]::MachineName + "." + | |
[Environment]::UserDomainName) -NoNewLine -ForegroundColor Cyan | |
Write-Host -NoNewLine -ForegroundColor White "::" | |
Write-Host -NoNewLine $(Resolve-Path .) -ForegroundColor Green | |
Write-Host -NoNewLine -ForegroundColor White "]" | |
Write-Host -ForegroundColor Magenta "$" | |
return "> " | |
} | |
function script:SetUIPreferences() { | |
$rawui = $host.UI.RawUI | |
$rawui.ForegroundColor = "white" | |
$rawui.BackgroundColor = "DarkBlue" | |
$rawui.WindowTitle = "Term" | |
} | |
function Start-Browser { | |
Param( | |
[Parameter(Mandatory=$true)] | |
[string] $Url, | |
[String] $Username, | |
[ValidateSet("IE","Chrome","Firefox")][string]$Browser = "IE" | |
) | |
$additionalParams = @{} | |
if ($username) { | |
$cred = Get-Credential -UserName $Username -Message "Open IE as $Username" | |
$additionalParams.Add("Credential", $cred) | |
} | |
$paths = @{ | |
"IE" = "Internet Explorer\iexplore.exe" | |
"Chrome" = "Google\Chrome\Application\chrome.exe" | |
"Firefox" = "Mozilla Firefox\firefox.exe" | |
} | |
$browserPath = Resolve-Path "${env:ProgramFiles(x86)}\$($paths[$Browser])" | |
Start-Process @additionalParams $browserPath $Url | |
} | |
Set-Alias subl "C:\Program Files\Sublime Text 3\sublime_text.exe" | |
#cd ~ | |
SetUIPreferences | |
#setup Git | |
. (Resolve-Path "$env:LOCALAPPDATA\GitHub\shell.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
sasv SPSearchHostController -WarningAction Ignore | |
sasv SPTimerV4 -WarningAction Ignore | |
sasv FIMService -WarningAction Ignore | |
sasv FIMSynchronizationService -WarningAction Ignore | |
sasv AppFabricCachingService -WarningAction Ignore |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment