aboutsummaryrefslogtreecommitdiff
path: root/.config/powershell/bootstrap.ps1
diff options
context:
space:
mode:
authorsrdusr <trevorgray@srdusr.com>2024-06-13 00:54:51 +0200
committersrdusr <trevorgray@srdusr.com>2024-06-13 00:54:51 +0200
commit4ccbe0270c25ecab492508b5b0209ae53b9c35bd (patch)
treebdb141f22716abab6c668dc309f34838c216174b /.config/powershell/bootstrap.ps1
parent68b6f7c08f07612010c3435894e5554b0492e498 (diff)
downloaddotfiles-4ccbe0270c25ecab492508b5b0209ae53b9c35bd.tar.gz
dotfiles-4ccbe0270c25ecab492508b5b0209ae53b9c35bd.zip
Testing
Diffstat (limited to '.config/powershell/bootstrap.ps1')
-rw-r--r--.config/powershell/bootstrap.ps112
1 files changed, 11 insertions, 1 deletions
diff --git a/.config/powershell/bootstrap.ps1 b/.config/powershell/bootstrap.ps1
index 3d95afa..71d971f 100644
--- a/.config/powershell/bootstrap.ps1
+++ b/.config/powershell/bootstrap.ps1
@@ -45,7 +45,7 @@ Write-Host "Configuring PowerShell"
Write-Host "----------------------------------------"
# Get the "MyDocuments" path for the current user, excluding OneDrive
-$UserMyDocumentsPath = [System.Environment]::GetFolderPath('MyDocuments').Replace("OneDrive", "") + "\Documents"
+$UserMyDocumentsPath = [System.Environment]::GetFolderPath('MyDocuments').Replace("OneDrive", "")
$PowerShellProfileDirectory = "$UserMyDocumentsPath\PowerShell"
$PowerShellLegacySymlink = "$UserMyDocumentsPath\WindowsPowerShell"
@@ -100,6 +100,16 @@ if (-not (Get-Command choco -ErrorAction SilentlyContinue)) {
Write-Host "Installing Applications"
Write-Host "----------------------------------------"
+# Check if the powershell-yaml module is installed, if not, install it
+if (-not (Get-Module powershell-yaml -ListAvailable)) {
+ $policy = Get-PSRepository -Name 'PSGallery' | Select-Object -ExpandProperty InstallationPolicy
+ Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted
+ Install-Module powershell-yaml
+ Set-PSRepository -Name 'PSGallery' -InstallationPolicy $policy
+}
+
+Import-Module powershell-yaml
+
# Load packages.yml
$packagesFile = "$HOME\packages.yml"
$packages = Get-Content $packagesFile | ConvertFrom-Yaml