Browsed by
Month: March 2016

Time Your Script with Timespan Objects

Time Your Script with Timespan Objects

Speed and consistency are the two main reasons people automate tasks using PowerShell. Give your script the same inputs and it should produce the same outputs. The consistency concept is easy. What about how much time is saved using PowerShell? We can achieve this using the Timespan object built into PowerShell. Start and Stop Times A rudimentary way of keeping track of time in your code is to use Get-Date. $StartTime = Get-Date Divide-Number -Dividend 39 -Divisor 3 $EndTime =…

Read More Read More

Why Use Source Control

Why Use Source Control

Source control, whether you’re writing one off scripts or automating intricate processes, is essential to your work. Simply keeping copies of your files scattered across your computer is not good enough. Source control will save you when you can’t figure out what changes you made that caused errors, when you can’t find the current version of your script, or when you have to work with a co-worker on you need to collaborate. Tracking Changes First and foremost, you want to…

Read More Read More