here is my Powershell default configuration in which I set up my PowerShell ise.. while it is adding in the modules I have a progress bar running lines 23-26 and after they are loaded I do a clear-host in line 41 which should close the progress bar.. but
$time = Get-Date $user = get-content env:usernameWrite-Output ( 'Hi, '+ $user +' Welcome Back! It is now '+$time)$mydocuments = [environment]::getfolderpath('mydocuments')$mytemp = '$mydocuments\windowsPowerShell\ScriptScratch'$mydoc = $mydocuments + '\WindowsPowerShell\Scripts\'Set-Variable -name HOME -value $mydoc -Forcewrite-output('Enumerating Modules')$modules = get-module -listavailableWrite-Output ('There are ' + {0} + ' Available' -f $modules.count)$modules.nameWrite-Output ('Hang on While I import modules')Write-Output ('Importing ' + {0} +' Modules' -f $modules.Count)if ([System.Windows.Input.Keyboard]::IsKeyDown('Ctrl') -eq $false){$counter = 0foreach ($module in $modules) { $counter ++ $total = $modules.Count $activity = "Importing Module: $module.name " Write-Progress -Activity $activity ` -status "Module: $counter of $total" ` -percentComplete ($counter / $modules.count*100) import-module -name $module.Name -erroraction SilentlyContinue -WarningAction SilentlyContinue }# Start-Steroids}#Leave any comments with the # sign#Install Quest Active Directory CMDLetsWrite-Output 'Installing Quest Active Directory Tools. Please wait...'Add-PSSnapin Quest.ActiveRoles.ADManagement -ErrorAction SilentlyContinueWrite-Output 'Installing Exchange Management Tools. Please wait...'Add-PSSnapin Microsoft.Exchange.Management.Powershell.Admin -ErrorAction SilentlyContinueWrite-Output 'Installing MDT Tools... Please wait..'Add-PSSnapIn Microsoft.BDD.PSSnapIn -ErrorAction SilentlyContinueWrite-Output 'Installing TFS Tools... Please wait..'Add-PSSnapin Microsoft.TeamFoundation.PowerShell -ErrorAction ContinueClear-Host#TFS only on Windows 10$version = get-wmiobject -class win32_operatingSystem | select-object versionif ($version.version -gt '10.0.0') { get-tfsserver -Name 'http://localhost:8080/tfs/Windows Powershell' #Script Browser Begin #Version: 1.3.2 Add-Type -Path 'C:\Program Files (x86)\Microsoft Corporation\Microsoft Script Browser\System.Windows.Interactivity.dll' Add-Type -Path 'C:\Program Files (x86)\Microsoft Corporation\Microsoft Script Browser\ScriptBrowser.dll' Add-Type -Path 'C:\Program Files (x86)\Microsoft Corporation\Microsoft Script Browser\BestPractices.dll' $scriptBrowser = $psISE.CurrentPowerShellTab.VerticalAddOnTools.Add('Script Browser', [ScriptExplorer.Views.MainView], $true) $scriptAnalyzer = $psISE.CurrentPowerShellTab.VerticalAddOnTools.Add('Script Analyzer', [BestPractices.Views.BestPracticesView], $true) $psISE.CurrentPowerShellTab.VisibleVerticalAddOnTools.SelectedAddOnTool = $scriptBrowser #Script Browser End }$time2 = Get-Date$time3 = $time2 - $timeWrite-Output ('It took ' + $time3.Minutes.ToString() + ' Minutes and ' + $time3.seconds.ToString() + ' Seconds to load the '+ $modules.Count + ' Modules')Write-Output ('The Current Time is:' +$time2)cd $mydoc