Repository with certain useful PowerShell Cmdlets, Scripts & Workflows.
A PowerShell cmdlet is a lightweight command that is used in the PowerShell environment. The PowerShell runtime invokes these cmdlets within the context of automation scripts that are provided at the command line.
- Get-CodedUIHTMLLogger
Description:
The function gets the generated Coded UI HTML logger report files from the 'Test Results' folder.
Usage Example:NOTE: Run cmdlet function file in PowerShell ISE and use below command for more help documentation and examples.Get-CodedUIHTMLLogger -TestResultsPath "C:\Test\TestResults" -Zipped -ZippedFileName "TestReports"
Get-Help Get-CodedUIHTMLLogger -Full
- Get-MatchedStringFromFiles
Description:
The function gets the matching string values from the supplied files.
Usage Example:NOTE: Run cmdlet function file in PowerShell ISE and use below command for more help documentation and examples.Get-MatchedStringFromFiles -FileFolderPath "C:\Files" -FileIncludeFilter "*.trx" -FileExcludeFilter "*.txt" -Regex ":::::::: Application ID: \[[0-9]{0,9}\]\; Student ID: \[[0-9]{0,9}\] ::::::::"
Get-Help Get-MatchedStringFromFiles -Full
- Restart-Servers
Description:
The function restarts the machines/servers provided as input to the cmdlet.
Usage Example:NOTE: Run cmdlet function file in PowerShell ISE and use below command for more help documentation and examples.Restart-Servers -Servers "PC1,PC2,PC3,PC4" -Username "domain\<username>" -Password "<password>" -WaitForServerToRestart "60" -PingRetries "4"
Get-Help Restart-Servers -Full
- Send-Email
Description:
The function sends email using SMTP Client.
Usage Example:NOTE: Run cmdlet function file in PowerShell ISE and use below command for more help documentation and examples.Send-Email -SMTPServer "<SMTP Server Address>" -SMTPPort "<SMTP Server Port>" -From "<From Address>" -Password "<Password>" -To "<To Addresses>" -Cc "<Cc Addresses>" -Bcc "<Bcc Addresses>" -Subject "<Subject Line>" -Body "<Email Body>" -AttachmentFolderPath "<Attachment Folder Path>" -AttachmentIncludeFilter "<Include Filter>" -AttachmentExcludeFilter "<Exclude Filter>"
Get-Help Send-Email -Full
- Update-InternetSettings
Description:
The function can manipulate internet settings provided as input to the cmdlet. Requires Internet Explorer to enforce changes.
Usage Example:NOTE: Run cmdlet function file in PowerShell ISE and use below command for more help documentation and examples.Update-InternetSettings -EnableAutomaticDetectSettings "E" -EnableAutomaticConfigScript "E" -SetAutomaticConfigurationURL "//configuration.pac" -EnableProxy "E" -SetProxyServer "http://proxy.internal.poxy.com.au:8080" -EnableBypassProxy "E" -SetBypassLocalAddresses "<local>;www.google.com;www.yahoo.com"
Get-Help Update-InternetSettings -Full
A PowerShell script is a plain text file that contains one or more PowerShell commands. PowerShell scripts have a .ps1 file extension. Running a script usually is a lot like running a cmdlet.
- Switch-ProcessorArchitecture64-Script
Description:
Switches Powershell running the 32-bit version on a 64-bit machine, forces PowerShell to run in 64-bit mode.
Usage Example:powershell -executionpolicy bypass -File ".\Scripts\Switch-ProcessorArchitecture64-Script.ps1"
A PowerShell workflow is a sequence of programmed, connected steps that perform long-running tasks or require the coordination of multiple steps across multiple devices or managed nodes. The benefits of a workflow over a normal script include the ability to simultaneously perform an action against multiple devices and the ability to automatically recover from failures.
- RunTest-Parallel
Description:
This workflow runs a supplied MSTest test in parallel.