PowerShell v2.0 for Win7PE
#1
Posted 05 February 2011 - 11:49 PM
It is new and I hope it works ok.
I have only tested with Win7_x86, but it should also work with x64-Source.
Powershell v2.0 not work without DotNet Framework!
Download:
Powershell.7z 35.46KB 109 downloads
Place it in Addons.
regards
2aCD
#2
Posted 06 February 2011 - 10:51 AM
I forgott an "End".
I have correct this and upload a new file.
(Thanks ChrisR)
regards
2aCD
#3
Posted 06 February 2011 - 11:02 AM
#4
Posted 06 February 2011 - 11:30 AM
This is WIN7 only. It will copy all files from the source. Required registry entries are not so much. Needs, of course DotNet. The files I have kept to the list from Microsoft. I tested it with little scripts. I'm glad if someone can test it also.
#5
Posted 07 February 2011 - 09:06 PM
However, I have a small problem at startup of Powershell module (look picture), I do not know any more, but the commands I tried worked well.
Powershell.exe directly works well, Maybe an additional shortcuts.
Attached Files
#6
Posted 08 February 2011 - 01:24 PM
.Net Runtime is enabled?
PowerShell has a task – Import System modules. This will immediately start to import all modules that are located in
%Systemroot%\System32\WindowsPowerShell\v1.0\Modules.
I think this error comes from applocker-modul.
Is this modul correct loaded.
wich modules are loaded? (get-module)
PowerShell.jpg 32.76KB 15 downloads
I also can delete the paramer -ImportSystemModule.
But I think its not the best way.
#7
Posted 08 February 2011 - 01:48 PM
Without netframework script, in default chrisr winpe_se project (full copy & standard copy); mscoree.dll is missing
#8
Posted 11 February 2011 - 10:22 PM
DirCopy - Failed to copy directory [%BaseDir%\Temp\Win7PE_SE\1Mount\InstallWimSrc\Windows\SysWow64\Windowspowershell\*] to: [%BaseDir%\Target\Win7PE_SE\Windows\SysWow64\WindowsPowerShell]: + s [Info] [//]
My Win7 is a 32 bit ultimate.
#9
Posted 12 February 2011 - 09:44 AM
The script copy
DirCopy,"%InstallSRC%\Windows\SysWow64\Windowspowershell\*","%TargetDir%\Windows\SysWow64\WindowsPowerShell"Only If the folder %TargetDir%\Windows\SysWow64 exist.
You should have an another script that create this folder. This folder SysWow64 must not exist in x86
I have no issue on my side
#10
Posted 12 February 2011 - 10:09 AM
UPDATE: It is not. I deleted the script and tried again enabling the Power Shell 2 script. Got the same error. For now, I will stick with the original Power Shell v1 - seems to work fine.
#11
Posted 12 February 2011 - 10:43 AM
In your case, the folder SysWow64 is probably create from another script that you added before this one .
At home, it does not exist in my full x86 building.
Anyway, I changed a little the script to test SysWow64 from the source "%InstallSRC%\Windows\SysWow64" Instead of "%TargetDir%\Windows\SysWow64"
Edit : Adding some mui and mscoree.dll !, if not already exist.
Attached Files
#12
Posted 12 February 2011 - 11:16 AM
No folder SysWow64 are copyed with x86 source, before powershell (placed in addons (new components) is running.
For test you can rename the powershell-script to 1-powershell. Now the same error?
You also rename the other addons to locate the problem-script, that copy the SysWow64 folder.
@ChrisR
Yes it is better to check sorce instead target, but I am also interested in the cause of the problem.
regards
2aCD
#13
Posted 12 February 2011 - 11:56 AM
I renamed, MSPowerShell.Script (in Components) to 1-powershell.script but unfortunately I got the error again. I am now trying ChrisR's mod. Unfortunately it is getting quite late here (10:54PM) and will have to report back in the morning (Australia) or evening (through out Europe). I am about to leave the build to continue and leave my laptop on. Thanks!
#14
Posted 12 February 2011 - 05:29 PM
now replace the line
If,EXISTDIR,%tWow%,Run,%ScriptFile%,CopyFiles_SySWoW64with
If,%SourceArch%,Equal,x64,If,EXISTDIR,%Wow%,Run,%ScriptFile%,CopyFiles_SySWoW64]I hope this resove the errors
sorry removed (buggy)
regards
2aCD
#15
Posted 12 February 2011 - 09:17 PM
I am also now testing 2aCD's change above. I will report as soon as the build gets completed.
#16
Posted 13 February 2011 - 12:40 AM
I just tested your changes but the error remains. ChrisR's changes however fixed the error.
Thanks for your help to both of you though.
If you still want me to test stuff, let me know what you want me to change and I will test it.
#17
Posted 13 February 2011 - 09:38 AM
sorry, I don't make chanches it the night.
It's better in the morning.
I have correct this errors und upload v4
MsPowerShell.7z 35.68KB 47 downloads
I hope, now run build without errors.
regards
2aCD
#18
Posted 14 February 2011 - 09:57 AM
I tested your changes. Good work! It works
#19
Posted 24 September 2011 - 02:04 PM
Problem 1:
.Net Framework64 install problem on x64 with .Net 2.0 only
I can't use .Net 2.0 only version because auf an error:
Run - Processed section [CopyNet2.0Core] in file: [%BaseDir%\Projects\Win7PE_SE\Components\DotNetFx.script]
FileCopy - Copied [%BaseDir%\Workbench\Common\Win7Extract\InstallWimSrc\Windows\Microsoft.NET\Framework64\v2.0.50727\AppLaunch.exe] to: [%BaseDir%\Target\Win7PESE\Windows\Microsoft.NET\Framework64\v2.0.50727]
FileCopy - File exists [%BaseDir%\Workbench\Common\Win7Extract\InstallWimSrc\Windows\Microsoft.NET\Framework64\v2.0.50727\CLR.mof] to: [%BaseDir%\Target\Win7PESE\Windows\Microsoft.NET\Framework64\v2.0.50727]: Overwritten
FileCopy - Failed to copy [%BaseDir%\Workbench\Common\Win7Extract\InstallWimSrc\Windows\Microsoft.NET\Framework64\v2.0.50727\CasPol.*] to: [%BaseDir%\Target\Win7PESE\Windows\Microsoft.NET\Framework64\v2.0.50727\]: "the directory name is invalid."
Halt
There is a file named "v2.0.50727" on the target directory and the copy action is aborted.
It seems that the directory "v2.0.50727" was not created before under Framework64.
[CopyNet2.0Only]
Run,%ScriptFile%,CopyNet2.0Core // maybe it should called Run,%ScriptFile%,CopyNet2.0Core,#1 OR create the missing dir before
Not sure which framework version should I use but in the next step I choosed "Full without Reference Assemblies run from RAM"
Problem 2:
32 Bit Powershell under x:\windows\syswow64\windowspowershell\v1.0\powershell.exe is not running correctly.
Because entries under HKLM\software\Wow6432Node\microsoft\powershell\... have a wrong path c:\windows\ instead of x:\windows\
After fixing this manual with regedit no error messages appear.
Problem 3:
I tried 64-Bit Powershell in the x:\windows\system32\windowspowershell\v1.0\powershell.exe directory.
But it says that there is no .Net Framework installed.
"Version v2.0.50727 of .Net Framework is not installed and it is required to run version 1 of Windows PowerShell."
#20
Posted 25 September 2011 - 10:00 PM
thank you for your feedback
Corrected by adding #1 (the folder ...\Framework64\... are created before the copy, with this parameter ) inProblem 1:
.Net Framework64 install problem on x64 with .Net 2.0 only
I can't use .Net 2.0 only version because auf an error:
[CopyNet2.0Only] Run,%ScriptFile%,CopyNet2.0Core,#1
Corrected in software_x64.regProblem 2:
32 Bit Powershell under x:\windows\syswow64\windowspowershell\v1.0\powershell.exe is not running correctly.
Because entries under HKLM\software\Wow6432Node\microsoft\powershell\... have a wrong path c:\windows\ instead of x:\windows\
Here are the two scripts fixed, thanks
DotNetFx-MsPowerShell.7z 36.78KB 24 downloads
I do not know much about powershell to test it, in x64 with "DotNet 2.0 only", it not seem to work correctly.Problem 3:
I tried 64-Bit Powershell in the x:\windows\system32\windowspowershell\v1.0\powershell.exe directory.
But it says that there is no .Net Framework installed.
"Version v2.0.50727 of .Net Framework is not installed and it is required to run version 1 of Windows PowerShell."
I tried basic commands powershell in x64 build with the option dotNet "full without Reference Assemblies", It seems to work better.
Powershell_x64.png 749.12KB 19 downloads
Regards,
Chris
#21
Posted 07 October 2011 - 11:25 AM
I noticed that there are no entries under:
HKLMSoftwareMicrosoftFusionNativeImagesIndexv2.0.50727_64
HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionSideBySideWinnersamd64_microsoft-windows-powershell-....
Do you have any entries there?
Thanks
#22
Posted 07 October 2011 - 09:23 PM
In fact, it seems to lack some key in x64 build. have you tried by adding them ?I tried your new scripts still I get the same error that .Net Framework is not installed with 64-Bit Powershell.
I noticed that there are no entries under:
HKLMSoftwareMicrosoftFusionNativeImagesIndexv2.0.50727_64
HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionSideBySideWinnersamd64_microsoft-windows-powershell-....
Do you have any entries there?
Thanks
I hope this is not a .Net issue and that the missing keys will be enough, Dotnet remains difficult in PE Grrrrrrrr
I try to add these keys to software_x64.reg and provide you soon a new script for test.
#23
Posted 07 October 2011 - 11:42 PM
I added keys which seemed to miss in x64 build (software_x64.reg)
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion\NativeImagesIndex\v2.0.50727_64
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\Winners\amd64_microsoft-windows-gpowershell
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\Winners\amd64_microsoft-windows-powershell
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\PowerShell
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\WSMAN\Plugin\Microsoft.PowerShell32
Can you try it again and give me feedback.
MsPowerShell.7z 23.05KB 24 downloads
Happy testing
#24
Posted 10 October 2011 - 11:14 AM
I tried it without success.
I have a logfile of sysinternals procmon 2.96 which I can send you. Don't see I can upload it here.
There are no files under x:windowswinsxs but I don't think they are needed because the x86 and msil files of powershell are missing, too.
And SidebySide is not supported by WinPe.
It seems more to be a .NET Framework problem.
#25
Posted 10 October 2011 - 12:24 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users