diff --git a/omp-themes/.gitignore b/omp-themes/.gitignore new file mode 100644 index 0000000..15c9ab0 --- /dev/null +++ b/omp-themes/.gitignore @@ -0,0 +1,4 @@ + +*.zip +*.ttf +oldprofile.ps1 diff --git a/pwsh/Microsoft.PowerShell_profile.ps1 b/pwsh/Microsoft.PowerShell_profile.ps1 index ba87eee..98a6090 100644 --- a/pwsh/Microsoft.PowerShell_profile.ps1 +++ b/pwsh/Microsoft.PowerShell_profile.ps1 @@ -78,6 +78,9 @@ function prompt { $adminSuffix = if ($isAdmin) { " [ADMIN]" } else { "" } $Host.UI.RawUI.WindowTitle = "PowerShell {0}$adminSuffix" -f $PSVersionTable.PSVersion.ToString() +# Importing custom alias and functions +Import-Module $HOME\pwshalias\alias-and-functions.ps1 + # Utility Functions function Test-CommandExists { param($command) diff --git a/pwsh/setup.ps1 b/pwsh/setup.ps1 index 4ca44f8..9ca7a0e 100644 --- a/pwsh/setup.ps1 +++ b/pwsh/setup.ps1 @@ -21,6 +21,20 @@ if (-not (Test-InternetConnection)) { break } +# Powershell alias and funtions directory creaton +$pwshalias = "$HOME\pwshalias" +If(!(test-path -PathType container $pwshalias)) +{ + New-Item -ItemType Directory -Path $pwshalias +} + +pwshaf = $pwshalias\alias-and-functions.ps1 +if (!(Test-Path "$pwshaf")) +{ + New-Item -path "$pwshalias" -name "alias-and-functions.ps1" -type "file" -value "## File Created" + Write-Host "Created new file and text content added" +} + # Profile creation or update if (!(Test-Path -Path $PROFILE -PathType Leaf)) { try {