randalldale Posted May 20, 2012 Share Posted May 20, 2012 Hello I'm trying to build a POCSERVER (Proof Of Concept Server) from this web site using Windows Server 2008 R2:www.deploymentresearch.com/Blog/tabid/62/EntryId/13/Hydration-Automating-builds-in-your-datacenter.aspxThe final phase isStep 3 – Create and deploy the virtual machines 1.Install the PowerShell Management Library for Hyper-V by running the install.cmd script, ignore any errors about .NET Framework 2.Verify that the files are not having any alternative data streams, if they do, remove it (using explorer or streams from Sysinternals). 3.Create the virtual machines by running the 4_CreateVirtualMachines.ps1 script. Here is the install.cmd script I have to use... and I get unsigned errors in the final phase when trying to run the PS1 files in the last line of this script because the 'ExecutionPolicy' by default is set to 'Restricted'. I can't just open another instance and set to unresricted as this only works for the current running windows so new windows open restricted.@echo off cls echo Installing HyperV Management Library for PowerShell echo ========================================================== echo. echo Ensuring that .Net Framework 2 and Windows PowerShell are installed Echo Press [ctrl][c] to abort or pause dism /online /enable-feature /featurename:NetFx2-ServerCore dism /online /enable-feature /featurename:MicrosoftWindowsPowerShell echo. echo About to create folder and copy Powershell module. Echo Press [ctrl][c] to abort or pause md "%ProgramFiles%\modules\HyperV" copy %0\..\HyperV_install\*.* "%ProgramFiles%\modules\HyperV" echo. echo About to set registry entries for PowerShell script execution, module path and console settings Echo Press [ctrl][c] to abort or pause start /D %0\.. /w regedit "PS_Console.REG" echo. echo About to Launch PowerShell Echo Press [ctrl][c] to abort or pause start %windir%\System32\WindowsPowerShell\v1.0\powershell.exe -noExit -Command "Import-Module '%ProgramFiles%\modules\Hyperv' "***I know I need to instert the "Set-ExecutionPolicy Unrestricted or -ExecutionPolicy Unrestricted " or something like this somewhere in the last line but everywhere I do I just get different errors.I'm hoping that this is simple enough that someone sees the issue right away as I was hoping to not have to go out and learn PS too quickly just to make this script work.Thanks,RD Link to comment Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now