install.fairie/home/.chezmoiscripts/windows/run_onchange_before_03-jumpcloud.ps1.tmpl
Brian Zalewski 0c560b8c89 Update 3 files
- /home/.chezmoiscripts/universal/run_onchange_before_03-jumpcloud.sh.tmpl
- /home/.chezmoiscripts/universal/run_onchange_before_03-jumpcloud-linux.sh.tmpl
- /home/.chezmoiscripts/windows/run_onchange_before_03-jumpcloud.ps1.tmpl
2023-04-20 02:06:32 +00:00

3 lines
No EOL
738 B
Cheetah

{{- if and (eq .host.distro.family "windows") (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (or (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "JUMPCLOUD_CONNECT_KEY")) (env "JUMPCLOUD_CONNECT_KEY")) -}}
cd $env:temp | Invoke-Expression; Invoke-RestMethod -Method Get -URI https://raw.githubusercontent.com/TheJumpCloud/support/master/scripts/windows/InstallWindowsAgent.ps1 -OutFile InstallWindowsAgent.ps1 | Invoke-Expression; ./InstallWindowsAgent.ps1 -JumpCloudConnectKey "{{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "JUMPCLOUD_CONNECT_KEY")) }}{{- includeTemplate "secrets/JUMPCLOUD_CONNECT_KEY" | decrypt -}}{{ else }}{{- env "JUMPCLOUD_CONNECT_KEY" -}}{{ end }}"
{{ end -}}