From c62987b454330e1a2538b8e7e20f532fbc3a7dbf Mon Sep 17 00:00:00 2001 From: Janic Mikes Date: Sat, 25 Sep 2021 08:26:39 +0200 Subject: [PATCH] feat: persist global pwsh profiles (#2702) --- bucket/pwsh.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bucket/pwsh.json b/bucket/pwsh.json index 1edb6e2ae6..4c3106d877 100644 --- a/bucket/pwsh.json +++ b/bucket/pwsh.json @@ -13,6 +13,14 @@ "hash": "b44702f129514e638798d62a6f3eacb62ef8a628052f71f1ceed179ede3d4564" } }, + "pre_install": [ + "if (!(Test-Path \"$persist_dir\\profile.ps1\")) {", + " New-Item -ItemType File \"$persist_dir\\profile.ps1\" | Out-Null", + "}", + "if (!(Test-Path \"$persist_dir\\Microsoft.PowerShell_profile.ps1\")) {", + " New-Item -ItemType File \"$persist_dir\\Microsoft.PowerShell_profile.ps1\" | Out-Null", + "}" + ], "bin": "pwsh.exe", "shortcuts": [ [ @@ -20,6 +28,10 @@ "PowerShell Core" ] ], + "persist": [ + "profile.ps1", + "Microsoft.PowerShell_profile.ps1" + ], "checkver": "github", "autoupdate": { "architecture": {