-
Notifications
You must be signed in to change notification settings - Fork 0
/
Profile.ps1
49 lines (41 loc) · 2.04 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
function Update-PowerShellProfile
{
[CmdletBinding()]
Param(
[Parameter(Mandatory=$false,
ValueFromPipelineByPropertyName=$false,
Position=0)]
$Branch = "master",
[Parameter(Mandatory=$false,
ValueFromPipelineByPropertyName=$false,
Position=1)]
$Repository = "mariussm/powershell-profile"
)
Invoke-RestMethod -OutFile $profile -Uri "https://raw.githubusercontent.com/$Repository/$Branch/Profile.ps1"
Invoke-RestMethod -OutFile (Join-Path (Split-Path -Parent -Path $profile) "Cmdlets.ps1") -Uri "https://raw.githubusercontent.com/$Repository/$Branch/Cmdlets.ps1"
Invoke-RestMethod -OutFile (Join-Path (Split-Path -Parent -Path $profile) "FIMPowerShellModule.psm1") -Uri "https://raw.githubusercontent.com/$Repository/$Branch/Modules/FIMPowerShellModule.psm1"
. $profile
}
. (Join-Path (Split-Path -Parent -Path $profile) "Cmdlets.ps1")
Import-Module (Join-Path (Split-Path -Parent -Path $profile) "FIMPowerShellModule.psm1")
if($env:USERPROFILE -and (pwd).Path.StartsWith("C:\Windows")) {
cd $env:USERPROFILE
}
function Get-PowerShellProfileInstallScript
{
[CmdletBinding()]
Param(
[Parameter(Mandatory=$false,
ValueFromPipelineByPropertyName=$false,
Position=0)]
$Branch = "master",
[Parameter(Mandatory=$false,
ValueFromPipelineByPropertyName=$false,
Position=1)]
$Repository = "mariussm/powershell-profile"
)
"Invoke-RestMethod -OutFile `$profile -Uri ""https://raw.githubusercontent.com/$Repository/$Branch/Profile.ps1""
Invoke-RestMethod -OutFile (Join-Path (Split-Path -Parent -Path `$profile) ""Cmdlets.ps1"") -Uri ""https://raw.githubusercontent.com/$Repository/$Branch/Cmdlets.ps1""
Invoke-RestMethod -OutFile (Join-Path (Split-Path -Parent -Path `$profile) ""FIMPowerShellModule.psm1"") -Uri ""https://raw.githubusercontent.com/$Repository/$Branch/Modules/FIMPowerShellModule.psm1""
. `$profile"
}