diff --git a/RdzeN-Profile.ps1 b/RdzeN-Profile.ps1 new file mode 100644 index 0000000..1ba066f --- /dev/null +++ b/RdzeN-Profile.ps1 @@ -0,0 +1,36 @@ +# gitea.RdzeN.net +# +# Example Powershell Profile. +# +# 1. Check if GITEA folder exists. + +$path_gitea = "$($env:USERPROFILE)\GITEA" +$path_gitea_powershell_profile = "$path_gitea\PowerShell-Profile" +$path_gitea_powershell_profile_functions = "$path_gitea_powershell_profile\functions" + +if (-not (Test-Path $path_gitea)) { + New-Item -ItemType Directory -Path $path_gitea | Out-Null +} +if (-not (Test-Path $path_gitea_powerShell_profile )) { + New-Item -ItemType Directory -Path $path_gitea_powerShell_profile | Out-Null +} +if (-not (Test-Path $path_gitea_powershell_profile_functions )) { + New-Item -ItemType Directory -Path $path_gitea_powershell_profile_functions | Out-Null +} + +# 2. Download / pull GIT REPO + +if (-not (Get-ChildItem $path_gitea_powershell_profile_functions).count -gt 0) { + Set-Location $path_gitea + $RepositoryURL = "https://gitea.rdzen.net/najlepszytomasz/PowerShell-Profile.git" + git clone $RepositoryURL -q +} else { + Set-Location $path_gitea_powershell_profile + git pull -q +} + +# 3. dot source functions. + + +# 99. Reload Profile +#Reload-Profile \ No newline at end of file diff --git a/functions/New-SimulateTyping.ps1 b/functions/New-SimulateTyping.ps1 new file mode 100644 index 0000000..7903cde --- /dev/null +++ b/functions/New-SimulateTyping.ps1 @@ -0,0 +1,17 @@ +# gitea.RdzeN.net +# Simulate Typing +function New-SimulateTyping { +param( +[string]$message +) + +# Iterate through each character in the text +foreach ($char in $message.ToCharArray()) { + # Write each character to the screen + Write-Host -NoNewline $char -ForegroundColor Yellow + # Wait before writing the next character (adjustable time in milliseconds) + Start-Sleep -Milliseconds (Get-Random -Minimum 10 -Maximum 100) +} + # New line after last char. + Write-Host "" +} \ No newline at end of file diff --git a/functions/Reload-Profile.ps1 b/functions/Reload-Profile.ps1 new file mode 100644 index 0000000..c5722a1 --- /dev/null +++ b/functions/Reload-Profile.ps1 @@ -0,0 +1,6 @@ +# gitea.RdzeN.net +# Reload $profile +function Reload-Profile { + . $PROFILE +} +New-SimulateTyping "Your PowerShell profile was reloaded!" \ No newline at end of file