File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 11Set-PSDebug - Trace 1
22
3+ # TODO make the script more compact
4+ # TODO add Set-Disk -Number 1 -IsOffline $true
5+
6+ # Desired HDD identifier
7+ # $targetFriendlyName = "WDC WD102KRYZ-01A5AB0"
8+ # $targetSerial = "VH1JR5YM"
9+
10+ # # Find the physical disk matching both FriendlyName and SerialNumber
11+ # $targetDisk = Get-PhysicalDisk | Where-Object {
12+ # $_.FriendlyName -eq $targetFriendlyName -and $_.SerialNumber -eq $targetSerial
13+ # }
14+
15+ # if (-not $targetDisk) {
16+ # Write-Error "Target disk not found using FriendlyName and SerialNumber."
17+ # exit 1
18+ # }
19+
20+ # # Map PhysicalDisk to corresponding Disk Number
21+ # $diskNumber = (Get-Disk | Where-Object {
22+ # $_.UniqueId -eq $targetDisk.UniqueId
23+ # }).Number
24+
25+ # if ($null -eq $diskNumber) {
26+ # Write-Error "Failed to match PhysicalDisk to Disk Number."
27+ # }
28+
29+ # # Offline the disk
30+ # try {
31+ # Set-Disk -Number $diskNumber -IsOffline $true -ErrorAction Stop
32+ # Write-Host "Disk $diskNumber offlined successfully."
33+ # } catch {
34+ # Write-Error "Failed to offline disk $diskNumber: $_"
35+ # }
36+
337cd " C:\Users\jr\initPC\Windows_1X\win_dotfiles"
438Start-Transcript - Path " hddoffOutput.log" - Append
539
You can’t perform that action at this time.
0 commit comments