mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-06-28 09:04:47 -05:00
Remove trailing whitespace characters (#2149)
* Remove All Trailing Whitespace Characters in '.ps1' Files * Remove All Trailing Whitespace Characters in '.json' Files * Remove All Trailing Whitespace Characters in '.yaml' Files * Remove All Trailing Whitespace Characters in Different Files * Remove Even More Trailing Whitespace Characters
This commit is contained in:
@ -1,27 +1,27 @@
|
||||
function ConvertTo-Icon {
|
||||
function ConvertTo-Icon {
|
||||
<#
|
||||
|
||||
|
||||
.DESCRIPTION
|
||||
This function will convert PNG to ICO file
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-Icon -bitmapPath "$env:TEMP\cttlogo.png" -iconPath $iconPath
|
||||
#>
|
||||
param( [Parameter(Mandatory=$true)]
|
||||
$bitmapPath,
|
||||
param( [Parameter(Mandatory=$true)]
|
||||
$bitmapPath,
|
||||
$iconPath = "$env:temp\newicon.ico"
|
||||
)
|
||||
|
||||
Add-Type -AssemblyName System.Drawing
|
||||
|
||||
if (Test-Path $bitmapPath) {
|
||||
$b = [System.Drawing.Bitmap]::FromFile($bitmapPath)
|
||||
$icon = [System.Drawing.Icon]::FromHandle($b.GetHicon())
|
||||
$file = New-Object System.IO.FileStream($iconPath, 'OpenOrCreate')
|
||||
$icon.Save($file)
|
||||
$file.Close()
|
||||
$icon.Dispose()
|
||||
#explorer "/SELECT,$iconpath"
|
||||
}
|
||||
else { Write-Warning "$BitmapPath does not exist" }
|
||||
)
|
||||
|
||||
Add-Type -AssemblyName System.Drawing
|
||||
|
||||
if (Test-Path $bitmapPath) {
|
||||
$b = [System.Drawing.Bitmap]::FromFile($bitmapPath)
|
||||
$icon = [System.Drawing.Icon]::FromHandle($b.GetHicon())
|
||||
$file = New-Object System.IO.FileStream($iconPath, 'OpenOrCreate')
|
||||
$icon.Save($file)
|
||||
$file.Close()
|
||||
$icon.Dispose()
|
||||
#explorer "/SELECT,$iconpath"
|
||||
}
|
||||
else { Write-Warning "$BitmapPath does not exist" }
|
||||
}
|
Reference in New Issue
Block a user