Skip to content

Instantly share code, notes, and snippets.

View kvprasoon's full-sized avatar
🙏
>_

PRASOON KARUNAN V kvprasoon

🙏
>_
View GitHub Profile
@dend
dend / toast.ps1
Last active August 23, 2024 03:19
Toast Notification in PowerShell
function Show-Notification {
[cmdletbinding()]
Param (
[string]
$ToastTitle,
[string]
[parameter(ValueFromPipeline)]
$ToastText
)
@bgelens
bgelens / Convert-PesterResultToJUnitXml.ps1
Created August 13, 2019 05:47
GitLab does not support NUnitXml as provided by Pester. Instead, it supports JUnitXml. This helper function takes the Pester output and generates a JUnitXml from it to be consumed by GitLab pipelines
function Convert-PesterResultToJUnitXml {
[CmdletBinding()]
param (
[Parameter(Mandatory)]
$PesterResult
)
$junit = '<?xml version="1.0" encoding="utf-8"?>'
$junit += "`n" + '<testsuites name="Pester" tests="{0}" failures="{1}" disabled="{2}" time="{3}">' -f @(
$PesterResult.TotalCount,
@devblackops
devblackops / Get-MostCommonCommands.ps1
Created June 13, 2019 23:07
Get your most common PowerShell commands by inspecting your PSReadLine history
$err=$null
[System.Management.Automation.PSParser]::Tokenize((Get-Content (Get-PSReadLineOption).HistorySavePath),[ref]$err) |
Where-Object {$_.type -eq 'command'} |
Select-Object Content | Group-Object Content |
Sort-Object Count, Name -Descending | Select-Object Count, Name -First 20
module PSFSharp.Stuff
open System.Management.Automation
[<Cmdlet("Get","Stuff")>]
type GetStuffCommand() as self =
inherit PSCmdlet()
override PSCmdlet.ProcessRecord() =
self.WriteObject(self.Param)
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")
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
)