질문과 답변
윈 도 우 시스템복원기능 활성화 방법으로 파워쉘 스크립트 오류 확인 부틱 드립니다.
2020.06.02 23:16
안녕하세요 아래 전문가님 도움 요청 드립니다.
원도우10 시스템복원 활성화 하는방법으로 파워쉘 스크립트로 한개씩 실행하면 되나
파워쉘 스크립트 파일(ps1)으로 작성하여 마우스 오른쪽 파워쉘에서 실행하면 관리자권한이 아니어서 오류가 발생되는데
쉽게cmd파일이나 ps1 관리자 권한 실행 가능하게 수정 가능한 정보 도움 요청 드립니다.
-rstr.ps1내용-
enable-computerrestore -drive "c:\"
vssadmin resize shadowstorage /on=c: /for=c: /maxsize=3%
checkpoint-computer -description "point01"
-실행bat파일 내용
Powershell.exe -noprofile -executionpolicy bypass -file "rstr.ps1"
또는 Powershell.exe -noprofile -executionpolicy bypass -Command "& './rstr.ps1'" -Verb runAs
댓글 [1]
-
DarknessAngel 2020.06.03 07:54
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
{
$arguments = "& '" + $myinvocation.mycommand.definition + "'"
Start-Process powershell -Verb runAs -ArgumentList $arguments
Break
}
아마 이걸로 될꺼에요