2013-05-31 12 views
1

powershell 스크립트를 실행하는 .bat 파일이 있습니다. 이것은Windows 8 Powershell 사용 -WindowsOptionalFeature 박쥐 파일

powershell -Command "& {Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerRole}" 

내가 전에 이런 짓을하고 난 또 다른 명령을 추가하고자한다면 내가 닫는 중괄호 앞에 세미콜론을 넣어 스크립트를 계속합니다.

그러나 이후 완성 된이 명령은 내가 선택한 처리 여부 또는 누군가가 인수에이를 전달하는 방법을 모르거나이 모든 단계를 방지합니까

enter image description here

는 A Y와 컴퓨터 또는 N을 다시 시작하지 않는 것이 필요

함께? 사전에

감사

참고 :

-NoRestart [<SwitchParameter>] 
    Suppresses reboot. If a reboot is not required, this command does nothing. This option will keep the 
    application from prompting for a restart or keep it from restarting automatically. 

가 재부팅을 억제 Enable-WindowsOptionFeature-NoRestart 플래그를 추가 : 당신은 Get-Help Enable-WindowsOptionalFeature -Full에서 adminstrator

답변

2

로 .BAT 파일을 실행해야합니다. 을 수행 한 경우을 완료 한 후 재부팅하려면 Restart-Computer 명령을 사용하십시오.