$argument1 = '-noprofile -command "Start-Process powershell.exe -Verb RunAs"'
$argument1 = '-noprofile -command "Start-Process powershell.exe -Verb RunAs -ArgumentList scriptName.ps1 "'
powershell.exe -NoExit -command .\install.ps1
$credential = New-Object System.Management.Automation.PsCredential("DOMAIN\admin_user", (ConvertTo-SecureString "password" -AsPlainText -Force))
Start-Process -FilePath C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Credential $credential -NoNewWindow
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
...
правда боится и говорит "небезопасно"
внутри
authroot.stl 167004 19.07.23 17:14