iNNOKENTIY21
Silver Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору function IsAdministrator { $user = [Security.Principal.WindowsIdentity]::GetCurrent() $admin = [Security.Principal.WindowsBuiltinRole]::Administrator (New-Object Security.Principal.WindowsPrincipal $user).IsInRole($admin) } if (IsAdministrator) { [console]::backgroundcolor = ($background = "DarkRed") [console]::foregroundcolor = ($foreground = "White") $host.privatedata.ErrorForegroundColor = "Red" $host.privatedata.ErrorBackgroundColor = $background $host.privatedata.WarningForegroundColor = "Yellow" $host.privatedata.WarningBackgroundColor = $background $host.privatedata.DebugForegroundColor = "Yellow" $host.privatedata.DebugBackgroundColor = $background $host.privatedata.VerboseForegroundColor = "Yellow" $host.privatedata.VerboseBackgroundColor = $background $host.privatedata.ProgressForegroundColor = "Yellow" $host.privatedata.ProgressBackgroundColor = $background Clear-Host } |