]> apps.delaporte.us Git - dotfiles.git/commitdiff
Merge branch 'main' of github.com:edthedev/dotfiles into main
authorEdward Delaporte <delaport@illinois.edu>
Thu, 22 Dec 2022 17:13:48 +0000 (11:13 -0600)
committerEdward Delaporte <delaport@illinois.edu>
Thu, 22 Dec 2022 17:13:48 +0000 (11:13 -0600)
install/favorite-ps-modules.ps1
setup/profile.ps1 [moved from install/profile.ps1 with 55% similarity]

index 214fc3351b3328d70809ef8ec171f68d3c13ee45..e8d72cc5f08965ee59863f3d5b3c0a237d23ad08 100644 (file)
@@ -3,4 +3,4 @@
 Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted\r
 \r
 # Install nice Git stuff.\r
-Install-Module -Name posh-git
\ No newline at end of file
+PowerShellGet\Install-Module posh-git -Scope CurrentUser -AllowPrerelease -Force
\ No newline at end of file
similarity index 55%
rename from install/profile.ps1
rename to setup/profile.ps1
index e1061ac3926703eb85285565b777acb7f56361c8..88bb380c3e8d0819a7d4d2a028af31f16243058e 100644 (file)
@@ -1,44 +1,30 @@
-<#\r
-.SYNOPSIS\r
-\r
-Setup EdTheDev's PowerShell Profile\r
-\r
-.NOTES\r
-\r
-#>\r
-\r
-# Setup my PowerShell Profile (on Windows)\r
-if(-Not(Test-Path -Path $profile)) {\r
-  New-Item -Path "$profile" -ItemType File\r
-}\r
-\r
-# Install Stub PowerShell Profile that sources the one from DotFiles\r
-$sourceMeFile = "$pwd\Microsoft.PowerShell_profile.ps1"\r
-$sourceMeLine = '$profileContents = [string]::join([environment]::newline, (get-content -path '\r
-$sourceMeLine += $sourceMeFile\r
-$sourceMeLine += '));invoke-expression $profileContents'\r
-\r
-# $doneFlagFile = "./DONE.md"\r
-# $doBootStrap = -Not (Test-Path -Path $doneFlagFile)\r
-\r
-$profileStuff = Get-Content -Path $profile \r
-if($profileStuff -Contains $sourceMeLine) {\r
-    Write-Host "Found profile source line: $sourceMeLine"\r
-    Write-Host "in file $profile"\r
-}\r
-else {\r
-    Write-Host "Profile source line will be added to $profile"\r
-    Add-Content -Path $profile -Value "" # Blank line to enforce newline.\r
-    Add-Content -Path $profile -Value $sourceMeLine\r
-}\r
-\r
-# Install profile for Windows Terminal\r
-# $destFile = "C:\Users\delaport\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\profiles.json"\r
-# if(-Not(Test-Path -Path $destFile)) {\r
-#  Copy-Item -Path ./profiles.json -Destination $destFile\r
-# } else {\r
-#  # Brute force ensure we update our git copy once in awhile.\r
-#  Copy-Item -Path $destFile -Destination ./profiles.json\r
-#}\r
-\r
-PowerShellGet\Install-Module posh-git -Scope CurrentUser -AllowPrerelease -Force
\ No newline at end of file
+<#
+.SYNOPSIS
+
+Setup EdTheDev's PowerShell Profile
+
+.NOTES
+
+#>
+
+# Setup my PowerShell Profile (on Windows)
+if(-Not(Test-Path -Path $profile)) {
+  New-Item -Path "$profile" -ItemType File
+}
+
+# Install Stub PowerShell Profile that sources the one from DotFiles
+$sourceMeFile = "$pwd\files\Microsoft.PowerShell_profile.ps1"
+$sourceMeLine = '$profileContents = [string]::join([environment]::newline, (get-content -path '
+$sourceMeLine += $sourceMeFile
+$sourceMeLine += '));invoke-expression $profileContents'
+
+$profileStuff = Get-Content -Path $profile 
+if($profileStuff -Contains $sourceMeLine) {
+    Write-Host "Found profile source line: $sourceMeLine"
+    Write-Host "in file $profile"
+}
+else {
+    Write-Host "Profile source line will be added to $profile"
+    Add-Content -Path $profile -Value "" # Blank line to enforce newline.
+    Add-Content -Path $profile -Value $sourceMeLine
+}