-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProfile.ps1
52 lines (42 loc) · 1.4 KB
/
Profile.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
. $PSScriptRoot\Server_Functions.ps1
. $PSScriptRoot\Private-Environment-Variables.ps1
if (Get-IsAdmin) {
Write-Verbose "Admin shell detected, don't get weather info to save time."
} else {
. $PSScriptRoot\Get-Weather.ps1
Get-Weather -City 'Fort%20Smith' -Country 'USA'
}
function Get-ServerList() {
Import-Clixml -Path $PSScriptRoot\Saved_Servers.xml
}
if (Get-Module -ListAvailable -Name Gamgee) { Import-Module -Name Gamgee -Global }
function global:Prompt {
# Set the title the current date and time
$Host.UI.RawUI.WindowTitle = (Get-Date -UFormat '%y/%m/%d %R').Tostring()
Write-Host "$env:USERNAME@$env:COMPUTERNAME " -ForegroundColor Cyan -NoNewline
Write-Host (Get-Location) -ForegroundColor Green
Write-Host '[' -NoNewline
Write-Host (Get-Date -UFormat '%T') -ForegroundColor Yellow -NoNewline
Write-Host ']:' -NoNewline
return "$ "
}
function Open-ProjectFolder () {
[CmdletBinding()]
[Alias('projects', 'Open-Projects')]
param ()
Set-Location "D:\Development\Projects"
}
function Format-Json([Parameter(Mandatory, ValueFromPipeline)][String]$json) {
$json | ConvertFrom-Json | ConvertTo-Json
}
function gimp() {
param (
$Version = '2.8'
)
if (Get-Command "gimp-$Version.exe" -ErrorAction SilentlyContinue) {
gimp-2.8.exe
}
else {
Write-Error "The previously stored gimp executable is no longer available. Please verify the version number is correct."
}
}