Skip to content

Instantly share code, notes, and snippets.

View PrateekKumarSingh's full-sized avatar

Prateek Singh PrateekKumarSingh

View GitHub Profile
Function Get-AgeAndGender()
{
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
[string] $ImagePath
)
$Splat = @{
Function Create-Form
{
#Calling the Assemblies
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
# Create the Conatainer Form to place the Labels and Textboxes
$Form = New-Object “System.Windows.Forms.Form”;
$Form.Width = 500;
$Form.Height = 400;
$Form.Text = 'Enter the required details'
Function Break-IntoWords()
{
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true)]
[string] $String
)
Process{
Foreach($S in (Clean-String $String))
Function Check-Spelling()
{
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True,Position=0,ValueFromPipeline=$True)]
[String] $String,
[Switch] $ShowErrors,
[Switch] $RemoveSpecialChars
)
Process{
Function Get-ImageText()
{
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True,Position=0,ValueFromPipeline=$True)]
[String] $Path
)
Process{
$SplatInput = @{
@PrateekKumarSingh
PrateekKumarSingh / Get-Snoverism.ps1
Last active October 24, 2020 07:48 — forked from dfinke/Get-Snoverism.ps1
Wisdom form the Shellfather, Jeffrey Snover - via Don Jones
Function Get-Snoverism
{
$URL = "http://snoverisms.com/"
(Invoke-WebRequest $URL).images.src |?{$_ -match 'quotes'}| Get-Random -Count 1 | %{$URL+$_}
}
Function Get-ImageText()
{
[CmdletBinding()]
Param(
Get-MailboxStatistics -Database DBNAME | where {$_.DisconnectReason -eq “SoftDeleted”} | `
%{Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState SoftDeleted -Confirm:$false}
#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))
Function Start-Translation()
{
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True,Position=0,ValueFromPipeline=$True)]
[String] $Text,
[String] [validateSet('Arabic','Hindi','Japanese','Russian','Spanish','French',`
'English','Korean','Urdu','Italian','Portuguese','German','Chinese Simplified')
]$From,
[String] [validateSet('Arabic','Hindi','Japanese','Russian','Spanish','French',`
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