Forum » Programiranje » Preveri SSD skripta
Preveri SSD skripta
mahoni ::
Na tem linku sem najdel en primer, ampak mi zdej ni cisto jasna ta skripta.
.DESCRIPTION
Used to verify that SSD is indeed first boot device on a system with two hard drives.
If necessary, sets a variable needed to switch installation drives.
Potem pa v main codi:
Ne razumem tega:
#Note: we need to make sure that SSD is not the first boot device, so we need to evaluate the disk number as well.
Pa saj ravno to zelim doseci, da bo SSD vedno prvi disk ozirima disk 0. Oziroma ali tu misli "first boot device", kjer ti diskpart pokaze 1 ?
Pa kako bi se dopolnil skripto, da gre skozi sledece kombinacije:
- ce sta dva razlicna SSD-ja, da precekira se velikost diskov in izbere tistega, ki je najmanjsi
- ce ima 1x SSD in 1x HDD, da izbere samo SSD
- ce ima 1x SSD in 1x NVMe, da izbere NVMe
?
.DESCRIPTION
Used to verify that SSD is indeed first boot device on a system with two hard drives.
If necessary, sets a variable needed to switch installation drives.
Potem pa v main codi:
# Start Main Code Here $ScriptName = $MyInvocation.MyCommand.Name . Logit "$($myInvocation.MyCommand) - Retrieving physical disks" . Logit "$($myInvocation.MyCommand) - Model set to $Model" Switch ($Model){ "HP ProDesk 600 G3 MT"{ #Note: we need to make sure that SSD is not the first boot device, so we need to evaluate the disk number as well $disksorder = Get-Disk | Select-Object Number,FriendlyName $physicaldisks = Get-PhysicalDisk | Select-Object FriendlyName,MediaType $disks = Join-Object -Left $disksorder -Right $physicaldisks -LeftJoinProperty FriendlyName -RightJoinProperty FriendlyName . Logit "$($myInvocation.MyCommand) - Processing retrieved physical disks." . Logit "$($myInvocation.MyCommand) - " $disks foreach($disk in $disks) { if($disk.MediaType -like "SSD" -and $disk.Number -gt "0") { . Logit "$($myInvocation.MyCommand) - SSD drive detected and it is not the first boot device." $TSenv.Value("IsNVMe") = "TRUE" Exit 0 } if($disk.MediaType -like "SSD" -and $disk.Number -eq "0") { . Logit "$($myInvocation.MyCommand) - SSD drive detected and it is the first boot device. No change required." Exit 0 } } } Default { . Logit "$($myInvocation.MyCommand) - $Model not supported, exit" Exit 0 } }
Ne razumem tega:
#Note: we need to make sure that SSD is not the first boot device, so we need to evaluate the disk number as well.
Pa saj ravno to zelim doseci, da bo SSD vedno prvi disk ozirima disk 0. Oziroma ali tu misli "first boot device", kjer ti diskpart pokaze 1 ?
Pa kako bi se dopolnil skripto, da gre skozi sledece kombinacije:
- ce sta dva razlicna SSD-ja, da precekira se velikost diskov in izbere tistega, ki je najmanjsi
- ce ima 1x SSD in 1x HDD, da izbere samo SSD
- ce ima 1x SSD in 1x NVMe, da izbere NVMe
?
- spremenilo: mahoni ()
Vredno ogleda ...
Tema | Ogledi | Zadnje sporočilo | |
---|---|---|---|
Tema | Ogledi | Zadnje sporočilo | |
» | Monitor nima signalaOddelek: Pomoč in nasveti | 1468 (1206) | MIHAc27 |
» | Onemogočen dostop do BIOS-aOddelek: Pomoč in nasveti | 1781 (1005) | SmeskoSnezak |
» | Mac OS Snow Leopard na PCOddelek: Operacijski sistemi | 4690 (3238) | Gray_Warden_ |
» | Excel - relative linkOddelek: Programska oprema | 1160 (1112) | Cold1 |
» | Inštaliranje Windows7 iz usbOddelek: Pomoč in nasveti | 3937 (3494) | king67 |