Get-ExecutionPolicy -List
public class Program
public static void Main(string[] args)
PS>$Code = (Get-Content D:\DetectSsd.cs) -join "`r`n"
PS>Add-Type -TypeDefinition $Code
PS>[DetectSsd.program]::Main('')
PS > [DetectSsd.program]::Main('')
Input physical drive number:
0
Select method (0: No seek penalty, 1: Nominal media rotation rate):
0
This drive has NO SEEK penalty.
PS > [DetectSsd.program]::Main('')
Input physical drive number:
0
Select method (0: No seek penalty, 1: Nominal media rotation rate):
1
This drive is NON-ROTATE device.
PS > [DetectSsd.program]::Main('')
Input physical drive number:
1
Select method (0: No seek penalty, 1: Nominal media rotation rate):
0
This drive has SEEK penalty.
PS > [DetectSsd.program]::Main('')
Input physical drive number:
1
Select method (0: No seek penalty, 1: Nominal media rotation rate):
1
This drive is ROTATE device.
PS > [DetectSsd.program]::Main('')
Input physical drive number:
2
Select method (0: No seek penalty, 1: Nominal media rotation rate):
0
DeviceIoControl failed. Неверная функция.
PS > [DetectSsd.program]::Main('')
Input physical drive number:
2
Select method (0: No seek penalty, 1: Nominal media rotation rate):
1
DeviceIoControl failed. Такой запрос не поддерживается.
$Code = @'
...
'@
Add-Type -TypeDefinition $Code
...
Get-PhysicalDisk
- это обёртка над WMI root\microsoft\windows\storage\MSFT_PhysicalDisk, как я уже говорил, 8+Add-Type
. не проверял. Но наверняка понадобятся админские права gwmi Win32_DiskDrive | fl *
Disks whose driver reports “no seek penalty”.
Disks that report a nominal media rotation rate of 1.
vars:
db_name: "{{ db_name }}"
prev_value = value
while True:
value = resolve_variables(value)
if value == prev_value:
break
prev_value = value