-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42f9f4e
commit dd09320
Showing
13 changed files
with
187 additions
and
29 deletions.
There are no files selected for viewing
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#description: Installs the latest Microsoft PowerShell | ||
#execution mode: Combined | ||
#tags: Evergreen, Microsoft, PowerShell | ||
#Requires -Modules Evergreen | ||
[System.String] $Path = "$Env:SystemDrive\Apps\Microsoft\PowerShell" | ||
|
||
#region Script logic | ||
New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null | ||
New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null | ||
|
||
try { | ||
Import-Module -Name "Evergreen" -Force | ||
$App = Get-EvergreenApp -Name "MicrosoftPowerShell" | ` | ||
Where-Object { $_.Architecture -eq "x64" -and $_.Release -eq "Stable" } | ` | ||
Select-Object -First 1 | ||
$OutFile = Save-EvergreenApp -InputObject $App -CustomPath $Path -WarningAction "SilentlyContinue" | ||
} | ||
catch { | ||
throw $_ | ||
} | ||
|
||
try { | ||
Write-Information -MessageData ":: Install Microsoft PowerShell" -InformationAction "Continue" | ||
$LogFile = "$Env:ProgramData\Nerdio\Logs\MicrosoftPowerShell$($App.Version).log" -replace " ", "" | ||
$params = @{ | ||
FilePath = "$Env:SystemRoot\System32\msiexec.exe" | ||
ArgumentList = "/package `"$($OutFile.FullName)`" /quiet /norestart ALLUSERS=1 /log $LogFile" | ||
NoNewWindow = $true | ||
Wait = $true | ||
PassThru = $true | ||
ErrorAction = "Continue" | ||
} | ||
$result = Start-Process @params | ||
Write-Information -MessageData ":: Install exit code: $($result.ExitCode)" -InformationAction "Continue" | ||
} | ||
catch { | ||
throw $_ | ||
} | ||
#endregion |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#description: Installs the latest 1Password CLI | ||
#execution mode: Combined | ||
#tags: Evergreen, 1Password | ||
|
||
#Requires -Modules Evergreen | ||
[System.String] $Path = "$Env:ProgramFiles\1Password CLI" | ||
|
||
#region Script logic | ||
New-Item -Path $Path -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null | ||
New-Item -Path "$Env:ProgramData\Nerdio\Logs" -ItemType "Directory" -Force -ErrorAction "SilentlyContinue" | Out-Null | ||
|
||
try { | ||
# Download - update when Evergreen supports 1Password CLI | ||
$App = [PSCustomObject]@{ | ||
Version = "2.23.0" | ||
URI = "https://cache.agilebits.com/dist/1P/op2/pkg/v2.23.0/op_windows_amd64_v2.23.0.zip" | ||
} | ||
$OutFile = Save-EvergreenApp -InputObject $App -CustomPath $Path -WarningAction "SilentlyContinue" | ||
Expand-Archive -Path $OutFile.FullName -DestinationPath $Path -Force | ||
Remove-Item -Path $OutFile.FullName -Force -ErrorAction "SilentlyContinue" | ||
|
||
# Add $Path to the system Path environment variable if it doesn't already exist | ||
if ([System.Environment]::GetEnvironmentVariable($Env:Path) -match "1Password") {} | ||
else { | ||
[System.Environment]::SetEnvironmentVariable("Path", | ||
[System.Environment]::GetEnvironmentVariable("Path", | ||
[System.EnvironmentVariableTarget]::Machine) + ";$Path", | ||
[System.EnvironmentVariableTarget]::Machine) | ||
} | ||
} | ||
catch { | ||
throw $_ | ||
} |
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
File renamed without changes.
File renamed without changes.
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
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
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
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
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
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
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