added a way to set custom functions
This commit is contained in:
parent
2cdf5fc247
commit
e9ee029058
4
omp-themes/.gitignore
vendored
Normal file
4
omp-themes/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
*.zip
|
||||
*.ttf
|
||||
oldprofile.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)
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user