From 45ff5e1e5f70f29c97dcffd38ba8d46561877a39 Mon Sep 17 00:00:00 2001 From: Taken Date: Wed, 21 Aug 2024 19:53:54 +0200 Subject: [PATCH] Updated profile Signed-off-by: Taken --- Microsoft.PowerShell_profile.ps1 | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Microsoft.PowerShell_profile.ps1 b/Microsoft.PowerShell_profile.ps1 index 1c40432..50e5920 100644 --- a/Microsoft.PowerShell_profile.ps1 +++ b/Microsoft.PowerShell_profile.ps1 @@ -1,6 +1,20 @@ -Import-Module -Name PSWindowsUpdate -Import-Module -Name gsudoModule -Import-module -Name Terminal-Icons +if (Get-Module -ListAvailable -Name PSWindowsUpdate) { + Import-Module -Name PSWindowsUpdate +} else { + Write-Host "PSWindowsUpdate module not found" -ForegroundColor Red +} + +if (Get-Module -ListAvailable -Name gsudoModule) { + Import-Module -Name gsudoModule +} else { + Write-Host "gsudoModule module not found" -ForegroundColor Red +} + +if (Get-Module -ListAvailable -Name Terminal-Icons) { + Import-Module -Name Terminal-Icons +} else { + Write-Host "Terminal-Icons module not found" -ForegroundColor Red +} # aliases Set-Alias -Name reboot -Value Restart-Computer