From 09628f088d0c800ff903251051b5fe2bec7685b8 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Mon, 26 Sep 2022 08:15:37 +0900 Subject: [PATCH] update: use Requires to simplify install.ps1 --- bin/install.ps1 | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/bin/install.ps1 b/bin/install.ps1 index 0e09de8..ff7b579 100644 --- a/bin/install.ps1 +++ b/bin/install.ps1 @@ -2,22 +2,11 @@ # dotfiles install script for Windows # check administration role -$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()) -$bool_admin = $currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) -if (!$bool_admin) { - Write-Warning -Message "require Admin privilage - please run as Administrator" - exit 1 -} +#Requires -RunAsAdministrator # check pwsh version # ≧ 7 -if ($PSVersionTable.PSVersion.Major -lt 7) { - Write-Warning -Message "pwsh version must be greater than 7 - please install powershell 7 (Core) - you can install via winget" - exit 1 -} +#Requires -Version 7 # check working directory if (!(