Last active
January 22, 2026 01:58
-
-
Save met/173022299df3784492c2121f33f4bd7f to your computer and use it in GitHub Desktop.
Power shell loader. Put into Dokuments\PowerShell\Microsoft.PowerShell_profile.ps1 Will load all .ps1 files from $dotfilesPath
This file contains hidden or 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
| # ------------------------------ | |
| # 💡 Main PowerShell profil | |
| # Edit: notepad $PROFILE | |
| # ------------------------------ | |
| # Uncomment to show all Write-Verbose output | |
| # $VerbosePreference = 'Continue' | |
| # Set directory with my .ps1 files | |
| $dotfilesPath = "$HOME\GitHub\dotfiles\powershell" | |
| # Load all *.ps1 files found in directory '$dotfilesPath' | |
| if (Test-Path $dotfilesPath) { | |
| Get-ChildItem $dotfilesPath -Filter *.ps1 | | |
| Sort-Object Name | | |
| ForEach-Object { | |
| try { | |
| . $_.FullName | |
| Write-Verbose "Loaded $($_.Name)" | |
| } | |
| catch { | |
| Write-Warning "Failed to load $($_.Name): $($_.Exception.Message)" | |
| } | |
| } | |
| } | |
| else { | |
| Write-Warning "Dotfiles folder not found: '$dotfilesPath'." | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment