Power Shell Tricks
5 Cool things you can do with Windows PowerShell
Windows PowerShell is a powerful tool for automating tasks and simplifying configuration and can be used to automate almost any task in the Windows ecosystem, including active directory and exchange.
1)Perform your favorite CMD task in Powershell: Yes, you can stop using the DOS prompt and start doing all of those same tasks within PowerShell. This can make learning a little easier and help you become more familiar with the interface. Unfortunately, from the run prompt, there is no three-letter launcher like cmd. But PowerShell will launch it. You can also assign a shortcut key to PowerShell so Ctrl + Shift + P launches it directly.
2)Insert timestamps into PowerShell outputs: For your PowerShell tasks, you can have a timestamp entered in series so you can determine how long a single step occurs or to use it as a logging mechanism for your scripts. I find this handy in Graphical PowerShell when I'm testing scripts. To insert a timestamp, enter one of the following commands as a single line within your .ps1 file:
3)Work from the keyboard in Graphical PowerShell: If you are familiar with the Microsoft SQL Query Analyzer environment, you will appreciate some of these keyboard shortcuts. In Graphical PowerShell, you can select a single line or multiple lines and execute them by pressing the F5 key. Also, if you have modified your script, the familiar Ctrl + S to save, Ctrl + Z to undo, Ctrl + C to copy, and Ctrl + V to paste are available to save you time in the editing and testing.
4)Ping devices locally or remotely: Test-NetConnection -ComputerName "Hostname or IP" The Test-NetConnection cmdlet offers a number of ways to test network connectivity on the LAN and WAN. Enter the command as typed above and the computer will essentially perform a ping to determine if network connectivity between the local device and the target computer or domain exists.'
5)Obtain IP Configuration details: Get-NetIPConfiguration
Similar to the ipconfig command, the Get-NetIPConfiguration cmdlet provides a holistic view of the network configuration(s) set on the network adapters of a computer. IP, DNS, and Gateway addresses are displayed and sorted by adapter name.
This comment has been removed by the author.
ReplyDelete