Powershell
--
Questions
--
Followers
Top Experts

$time = Get-Date
$user = get-content env:username
Write-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 -Force
write-output('Enumerating Modules')
$modules = get-module -listavailable
Write-Output ('There are ' + {0} + ' Available' -f $modules.count)
$modules.name
Write-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 = 0
foreach ($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 CMDLets
Write-Output 'Installing Quest Active Directory Tools. Please wait...'
Add-PSSnapin Quest.ActiveRoles.ADManagement -ErrorAction SilentlyContinue
Write-Output 'Installing Exchange Management Tools. Please wait...'
Add-PSSnapin Microsoft.Exchange.Management.Powershell.Admin -ErrorAction SilentlyContinue
Write-Output 'Installing MDT Tools... Please wait..'
Add-PSSnapIn Microsoft.BDD.PSSnapIn -ErrorAction SilentlyContinue
Write-Output 'Installing TFS Tools... Please wait..'
Add-PSSnapin Microsoft.TeamFoundation.PowerShell -ErrorAction Continue
Clear-Host
#TFS only on Windows 10
$version = get-wmiobject -class win32_operatingSystem | select-object version
if ($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 - $time
Write-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
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
Powershell
--
Questions
--
Followers
Top Experts
Windows PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language built on the .NET Framework. PowerShell provides full access to the Component Object Model (COM) and Windows Management Instrumentation (WMI), enabling administrators to perform administrative tasks on both local and remote Windows systems as well as WS-Management and Common Information Model (CIM) enabling management of remote Linux systems and network devices.