-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathFix-AMDJpegDecoder.ps1
More file actions
40 lines (35 loc) · 1.3 KB
/
Copy pathFix-AMDJpegDecoder.ps1
File metadata and controls
40 lines (35 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function Fix-AMDJpegDecoder {
[CmdletBinding(SupportsShouldProcess=$true)]
Param(
[Parameter(ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
Position=0)]
[alias('PSSession')]
[System.Management.Automation.Runspaces.PSSession[]]
$Session
)
Begin {
if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]"Administrator")){
Write-Warning "You do not have Administrator rights to run this script!`nPlease re-run this script as an Administrator!"
Break
}
}
Process{
Invoke-Command -Session $Session -ScriptBlock {
$path = "C:\Program Files\Common Files\ATI Technologies\Multimedia"
Get-childItem -Path $path -filter "amf-wic-*" |
foreach {
Rename-Item -Path $_.fullname -newname "amf-wic-jpeg-decoder.dll.$(get-random -Maximum 99 -Minimum 0).broken" -Force
}
Get-childItem -Path $path -filter "amf-wic-*"
}
}
}
if($args[0]){
try{
$session = New-PSSession $args[0] -ErrorAction Stop
} catch {
throw $psItem
}
Fix-AMDJpegDecoder -Session $session
}