The major benefit of using modules is that you can unload them from the shell if you need to, and it keeps the variables in the functions from creeping into the shell (once you dot source a function file, try calling one of the variables from a function in the ...
A "tail -f" equivalent command in Powershell to show real time logging A call to SSPI failed A connection to the directory on which to process the request was unavailable. This is likely a transient condition. A fast way to remove duplicated lines from an unsorted text file? a lot of...
& (Get-Command -Name Map -CommandType Function) or & (dir Function:\map) You can also save your hidden command in a variable to make it easier to run. For example, the following command saves the Map function in the $myMap variable and then uses the Call operator to run it. $my...
This template is good for any advanced function that needs to get information, but not actually make any changes to the state of the system. For advanced functions that will change the state of the system, you need to implement a few extra items. With that in mind, here’s a second ...
To make a dynamic module available to Get-Module, pipe a New-Module command to Import-Module, or pipe the module object that New-Module returns, to Import-Module. This action adds the dynamic module to the Get-Module list, but it does not save the module to disk or make it persistent...
Finding the time to automate our simple and repeatable tasks is the first blocker. Does the time it takes to automate something make sense? In this blog we are going to look at AI, can it help us be more effective at our jobs? I am going to ask ChatGPT to w...
The DHTML options is also a nice method to make the menu in your HTA look nicer. FIM Hello ScriptBox is an example for a HTA that uses DHTML to implement a nicer menu.Note After you have downloaded the Zip file to your computer, you ...
New versions of PowerShell include PSReadline, which can be used to do this: Set-PSReadlineKeyHandler -Key Tab -Function Complete or, to make it even more like bash where you can use arrow-keys to navigate available options: Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete To mak...
Compiled commands in PowerShell are known as cmdlets, pronounced as"command-let", not"CMD-let". The naming convention for cmdlets follows a singularVerb-Nounformat to make them easily discoverable. For instance,Get-Processis the cmdlet to determine what processes are running, andGet-Serviceis th...
Let’s start a debug session. First, make sure the DebugTest.ps1 file’s editor window is still the active window, and then press F5 or click the greenStart Debuggingbutton to the left of the Launch Configuration dropdown (shown in the previous screenshot). ...