This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-DictionaryWord | |
{ | |
[Cmdletbinding()] | |
Param( | |
[String]$StartingAlphabet | |
) | |
$Results = @() | |
$i = 1 | |
$StartingAlphabet = $StartingAlphabet.toLower() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-MP3MetaData | |
{ | |
[CmdletBinding()] | |
[Alias()] | |
[OutputType([Psobject])] | |
Param | |
( | |
[String] [Parameter(Mandatory=$true, ValueFromPipeline=$true)] $Directory | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Start-MediaPlayer | |
{ | |
[cmdletbinding()] | |
Param( | |
[Alias('P')] [String] $Path, | |
[Alias('Sh')] [switch] $Shuffle, | |
[Alias('St')] [Switch] $Stop, | |
[Alias('L')] [Switch] $Loop | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Install IIS Feature | |
Install-WindowsFeature -Name Web-Server -IncludeManagementTools | |
#Install FTP feature | |
Install-WindowsFeature -Name Web-Ftp-Server -IncludeAllSubFeature -IncludeManagementTools -Verbose | |
#Creating new FTP site | |
$SiteName = "Demo FTP Site" | |
$RootFolderpath = "C:\DemoFTPRoot" | |
$PortNumber = 21 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-TwitterProfile | |
{ | |
[cmdletbinding()] | |
Param( | |
$URL = "https://twitter.com/followers" | |
) | |
Begin | |
{} | |
Process |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Create-HTMLDOMFromFile | |
{ | |
Param( | |
[String] $FileName, | |
[String] $TagName, | |
[Int] $OuputCount = 11 | |
) | |
$HTML = New-Object -Com "HTMLFile"; | |
$Content = Get-Content -Path $FileName -raw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Content = @" | |
<HTML> | |
<BODY> | |
<h1> This is a heading </h1> | |
<P id='para1'>First Paragraph with some Random text</P> | |
<P>Second paragraph with more random text</P> | |
<A href="http://Geekeefy.wordpress.com">Cool Powershell blog</A> | |
</BODY> | |
</HTML> | |
"@ | Out-File File.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Gets information of a port number | |
.DESCRIPTION | |
Function provides detailed information of port numbers, like - the service which use the port, Transport protocol and a small decsription. | |
.EXAMPLE | |
PS > Get-Port -Port 20,21,53 | |
Port Service Protocol Description | |
---- ------- -------- ----------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tokenizing Powershell script | |
# 1. From Content of a File | |
[System.Management.Automation.PSParser]::Tokenize((Get-Content $path), [ref]$null) | |
# 2. From content of Current file in Powershell ISE | |
[System.Management.Automation.PSParser]::Tokenize($PSISE.CurrentFile.Editor.Text, [ref]$null) | |
# 3. From a String | |
[System.Management.Automation.PSParser]::Tokenize('$c= $a+$b', [ref]$null) | |
# 4. Current File in VScode using Powershell editor services (only on VSCode) | |
$psEditor.GetEditorContext().currentfile.tokens.gettype() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Retries a powershell command n-times. | |
.DESCRIPTION | |
The cmdlet is capable of retrying a PowerShell command passed as a [ScriptBlock] according to the user defined number of retries and timeout (In Seconds) | |
.PARAMETER TimeoutInSecs | |
Timeout in secods for each retry. |
NewerOlder