Powershell - Récupérer les informations de licence, serial et bios, Hdd

Rédigé par Xpress Aucun commentaire
Classé dans : Powershell Mots clés : Powershell, Récupérer, Infos, Bios, Licence, Modèle, Hdd
Récupérer la licence windows 
wmic path softwarelicensingservice get OA3xOriginalProductKey

Récupérer le numéro de série
wmic bios get serialnumber

Récupérer des informations complémentaires sur le bios
Get-WmiObject -Class Win32_BIOS -NameSpace "rootCIMV2" -ComputerName localhost

Récupérer des informations sur les disques
wmic diskdrive get model,name,serialnumber

Récupérer des informations complémentaires sur les disques 
wmic diskdrive get Name,Model,SerialNumber,Size,Status

Powershell - Couleurs

Rédigé par Xpress Aucun commentaire
Classé dans : Powershell Mots clés : Powershell, Couleurs

$host.privatedata.ErrorForegroundColor="Green"

$host.privatedata


Set-PSReadLineOption -colors @{ Command = "Green"}



$profile |format-list * -force

Get-PSReadLineOption

Set-PSReadLineOption -colors @{ ErrorForegroundColor = "Magenta"}
$host.privatedata.ErrorForegroundColor="Green"


Set-PSReadlineOption -Tokenkind ErrorForegroundColor -Color Magenta

----------------
lister les couleurs
[Enum]::GetValues([System.ConsoleColor])
[Enum]::GetValues([ConsoleColor])

---------------------
Set-PSReadlineOption -TokenKind Operator -ForegroundColor "Magenta"
Set-PSReadlineOption -TokenKind Command -ForegroundColor "DarkYellow"
Set-PSReadlineOption -TokenKind Parameter -ForegroundColor "Magenta"
-------------------


$colors = [enum]::GetValues([System.ConsoleColor])
Foreach ($bgcolor in $colors){
    Foreach ($fgcolor in $colors) { Write-Host "$fgcolor|"  -ForegroundColor $fgcolor -BackgroundColor $bgcolor -NoNewLine }
    Write-Host " on $bgcolor"


Fil RSS des articles