» »

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:

# 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 ()

mahoni ::

Nihce ne zna powershella?

Ahim ::

mahoni je izjavil:

Nihce ne zna powershella?

Ti ne znas powershella.


Vredno ogleda ...

TemaSporočilaOglediZadnje sporočilo
TemaSporočilaOglediZadnje sporočilo
»

Monitor nima signala

Oddelek: Pomoč in nasveti
271406 (1144) MIHAc27
»

Onemogočen dostop do BIOS-a

Oddelek: Pomoč in nasveti
191745 (969) SmeskoSnezak
»

Mac OS Snow Leopard na PC

Oddelek: Operacijski sistemi
484653 (3201) Gray_Warden_
»

Excel - relative link

Oddelek: Programska oprema
51131 (1083) Cold1
»

Inštaliranje Windows7 iz usb

Oddelek: Pomoč in nasveti
143911 (3468) king67

Več podobnih tem