-
< # .SYNOPSIS This script creates then copies a file using System.IO.Fileinfo.CopyTo() .DESCRIPTION This script first creates a temporary file, then copies it to another file then deletes...
-
< # .SYNOPSIS This script displays the size of a folder .DESCRIPTION This script is a rewrite of an MSDN sample. It uses System.IO namespace to determine the size of a folder and...
-
< # .SYNOPSIS This script displays the versions of SQL Server running on a system .DESCRIPTION This script uses WMI to get the SQLServiceAdvancedProperty class from the ComputerManagement namespace to print out...
-
< # .SYNOPSIS This script uses ADSI to add a new OU to a domain. .DESCRIPTION This script creates a pointer to the domain, then uses the Create method to create a new OU under the root...
-
And another WTF Programing Praxis : Nerds, Jocks, and Lockers function get-OpenLockers ($num){1..([math]::sqrt($num))|%{$_*$_}} Enjoy, Greetings /\/\o\/\/ Read More...
-
When I teach PowerShell, I point out the consistency within and across the product. When you learn something, it can be broadly used in other circumstances. This is the power of knowledge transfer – learning things once and using that knowleldge to solve...
-
< # .SYNOPSIS This script checks of a particular date in the past was a Thurday. .DESCRIPTION This script creates a DateTime object set for 1st May, 2003. The script then check to see if that day is a Thursday...
-
< # .SYNOPSIS This script uses the System.Net.Networkinginformation.Networknterface class to get all network interface detais and displays the DNS addresses configured. .DESCRIPTION This script first gets all the...
-
< # .SYNOPSIS This script demonstrates the use of System.Environment .DESCRIPTION This script Uses a variety of the members of System.Environment and is a re-write of a MSDN Sample Script .NOTES ...
-
And another PowerShell excersise from the WTF (Worse than Failure) contest Programming Praxis: Josephus' Circle . (for more info see original contest post) Function get-SafeSpot ($count,$Skip) { $q = [Collections.queue](1..$count) while ($q.count -gt 1){ 1..($skip-1) |% {$q.enqueue($q.dequeue())...
-
When you have a GUID object in PowerShell by default this gives no output, only some empty lines. See output below : PS C:\> [GUID]$a = "00000000-0000-0000-0000-000000000000" PS C:\> $a PS C:\> $a.ToString() 00000000-0000-0000-0000-000000000000 PS C:\> "$a" 00000000-0000...
-
Small PowerShell exercise taken from the Programming Praxis: Russian Peasant Multiplication contest of WTF (Worse than Failure) implementing the Russian Peasant Multiplication method (for more info see original contest post) function Invoke-RussianMultiply ([int]$a,[int]$b) { "$a x $b" $r ...
-
< # .SYNOPSIS This script displays the usage of the Exists and the copy methods of System.IP.File .DESCRIPTION This script sets up two file names, then checks to see if the...
-
< # .SYNOPSIS This script illustrates the CompareExchange Method .DESCRIPTION This script creates three values, and calls CompareExchange method, and displays the results. The first time, we compare two non-equal...
-
< # .SYNOPSIS This script illustrates the Compare Exchage Method .DESCRIPTION This script creates three values, and calls CompareExchange method, and displays the results. The first time, we compare to non-equal...