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
<# | |
Disconnect-wsession: forefully logoff a user's session using the qwinsta.exe / rwinsta.exe commands | |
Purpose: prevent automatic account lockout | |
Defaults to logging off the current user's session on the remote computer. | |
#> | |
function disconnect-wsession ($computer, $username) { | |
$username = if ($username) {$username} else {$env:username} | |
if (test-connection $computer -count 1) { |
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
$ipath = "C:\PATH_TO_THUMBNAILS" | |
$images = gci -Path $ipath | |
$jpgBytes = $null | |
foreach ($image in $images) { | |
$jpgBytes = $null | |
$jpgBytes = [byte[]]$jpg = Get-Content ($image.fullName) -encoding byte |
NewerOlder