Commit db34e2a1 authored by Dustin L. Howett's avatar Dustin L. Howett

Add my existing configuration

parent 315afe8f
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true, ValueFromPipeline=$true)]
[String[]]
$Disks
)
$shlApp = New-Object -ComObject Shell.Application
$thisPc = $shlApp.Namespace(17)
$nEjected = 0
foreach($disk in $Disks) {
$shlDisk = $thisPc.ParseName($disk)
if($shlDisk) {
$ejectVerb = $shlDisk.Verbs() | Where { $_.Name -eq "E&ject" }
if($ejectVerb) {
$ejectVerb.DoIt()
$nEjected++
} else {
Write-Host -ForegroundColor Red "$disk is not removable."
}
} else {
Write-Host -ForegroundColor Red "$disk is not mounted."
}
}
Write-Host "$nEjected volume$(@{$true='s';$false=''}[$nEjected -ne 1]) ejected."
Write-Host ""
[CmdletBinding()]
Param (
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
[string[]]$Files
)
& clang-format -i ($Files -Join " ")
Param (
[String[]]
$InputStrings
)
If($null -eq $InputStrings) {
$InputStrings = @($input)
}
$Script:n = 0
$InputStrings | Select -Property (
@{Name="S";Expression={$_}},
@{Name="U";Expression={$_.ToUpper()}},
@{Name="I";Expression={$Script:n++; $Script:n}}
) | Sort -Property U -Unique | Sort -Property I | Select -ExpandProperty S
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment