Skip to content

abhinavminhas/posh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

posh

Repository with certain useful PowerShell Cmdlets, Scripts & Workflows.

maintainer License: MIT

Cmdlets

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:
    Get-CodedUIHTMLLogger -TestResultsPath "C:\Test\TestResults" -Zipped -ZippedFileName "TestReports"
    
    NOTE: Run cmdlet function file in PowerShell ISE and use below command for more help documentation and examples.
    Get-Help Get-CodedUIHTMLLogger -Full
    

  • Get-MatchedStringFromFiles
    Description:
    The function gets the matching string values from the supplied files.
    Usage Example:
    Get-MatchedStringFromFiles -FileFolderPath "C:\Files" -FileIncludeFilter "*.trx" -FileExcludeFilter "*.txt" -Regex ":::::::: Application ID: \[[0-9]{0,9}\]\; Student ID: \[[0-9]{0,9}\] ::::::::"
    
    NOTE: Run cmdlet function file in PowerShell ISE and use below command for more help documentation and examples.
    Get-Help Get-MatchedStringFromFiles -Full
    

  • Restart-Servers
    Description:
    The function restarts the machines/servers provided as input to the cmdlet.
    Usage Example:
    Restart-Servers -Servers "PC1,PC2,PC3,PC4" -Username "domain\<username>" -Password "<password>" -WaitForServerToRestart "60" -PingRetries "4"
    
    NOTE: Run cmdlet function file in PowerShell ISE and use below command for more help documentation and examples.
    Get-Help Restart-Servers -Full
    

  • Send-Email
    Description:
    The function sends email using SMTP Client.
    Usage Example:
    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>"
    
    NOTE: Run cmdlet function file in PowerShell ISE and use below command for more help documentation and examples.
    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:
    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"
    
    NOTE: Run cmdlet function file in PowerShell ISE and use below command for more help documentation and examples.
    Get-Help Update-InternetSettings -Full
    

Scripts

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"
    

Workflows

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.

About

⚡ PowerShell Cmdlets, Scripts & Workflows ⚡

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published