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
# Parameter Definition | |
Param | |
( | |
[Parameter(mandatory = $true)] [String] $DPMServer, | |
[String] $SendEmailTo, | |
[String] $OutputDirectory, | |
[String] $SMTPServer | |
) | |
# HTML Body Definition Start |
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-Direction() | |
{ | |
Param( | |
[Parameter(Mandatory=$true,Position=0)] $Origin, | |
[Parameter(Mandatory=$true,Position=1)] $Destination, | |
[Parameter(Position=2)] [ValidateSet('driving','bicycling','walking')] $Mode ="driving", | |
[Switch] $InMiles | |
) | |
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 Auto-Complete() | |
{ | |
Return (Invoke-RestMethod -Uri "http://api.bing.com/qsml.aspx?query=$($TextBox1.text)").searchsuggestion.section.item.text | |
} | |
Function Create-WinForm() | |
{ | |
#Calling the Assemblies | |
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") |
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
Get-MailboxStatistics -Database DBNAME | where {$_.DisconnectReason -eq “SoftDeleted”} | ` | |
%{Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState SoftDeleted -Confirm:$false} |
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
#Exchange | |
Import-pssession $(New-PSSession -ConfigurationName Microsoft.Exchange ` | |
-ConnectionUri http://CAS_SERVER/PowerShell/ -Authentication Kerberos -Credential (Get-Credential)) | |
#Lync | |
Import-pssession $(New-PSSession -ConnectionUri https://LYNC_SERVER_FQDN/ocspowershell/ -Credential (Get-Credential)) |
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
Get-Content C:\server.txt | ` | |
foreach { Test-Connection ($_.ToString()+'ilo') -Count 1} ` | |
| ft -property @{l='Server Name';e={(($_.address).split("ilo"))[0]}}, @{l='iLO Ip Address';e={$_.ipv4address}} -AutoSize |
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 Change-BackgroundColor | |
{ | |
[CmdletBinding()] | |
Param( | |
[Parameter(Position=0,ValueFromPipeline=$True)] | |
[String] $Color | |
) | |
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 Start-Recursion($Times, $Upto) | |
{ | |
If($Times -gt $Upto){$Times;Start-Recursion($Times-1)}else{break} | |
} | |
Start-Recursion 100 0 |
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-RandomMusic($directory) | |
{ | |
Start-Process (gci $directory -Filter *.mp3 |Get-Random -Count 1).fullname -verb 'play' | |
} | |
Start-RandomMusic C:\Users\Prateek\downloads\ |
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 Search-PowershellScript | |
{ | |
Param( | |
[Parameter(Mandatory=$true)] [String] $Directory, | |
[Parameter(Mandatory=$true)] [String] $Keyword, | |
[String] $Extension = ".ps1", | |
[Switch] $ShowMatchResult | |
) |
OlderNewer