-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathfind-powershell-assembly.ps1
More file actions
21 lines (19 loc) · 1.04 KB
/
Copy pathfind-powershell-assembly.ps1
File metadata and controls
21 lines (19 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$locations = @(
"C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Management.Automation\v4.0_3.0.0.0__31bf3856ad364e35\System.Management.Automation.dll",
"C:\Windows\assembly\GAC_MSIL\System.Management.Automation\1.0.0.0__31bf3856ad364e35\System.Management.Automation.dll",
"C:\Program Files\Reference Assemblies\Microsoft\WindowsPowerShell\3.0\System.Management.Automation.dll",
"C:\Program Files (x86)\Reference Assemblies\Microsoft\WindowsPowerShell\3.0\System.Management.Automation.dll",
"C:\Windows\System32\WindowsPowerShell\v1.0\System.Management.Automation.dll"
)
Write-Host "Searching for System.Management.Automation.dll..."
foreach ($location in $locations) {
if (Test-Path $location) {
Write-Host "FOUND: $location"
} else {
Write-Host "NOT FOUND: $location"
}
}
Write-Host "`nSearching all drives for PowerShell assemblies..."
Get-ChildItem -Path "C:\" -Filter "System.Management.Automation.dll" -Recurse -ErrorAction SilentlyContinue | ForEach-Object {
Write-Host "FOUND AT: $($_.FullName)"
}