-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running BiosSledgehammer.ps1 from SCCM task sequence #79
Comments
This is odd. Can you please enter the command Also, just to be sure: You start this once the OS has started for the first time, not within Windows PE? |
Yes at least i have a restart computer task that boots "The currently installed default operating system". before running the Sledgehammer script. |
PSVersion: 5.1.17134.1 |
I commented out the line 561, 565 and 713 in MPSXM.psm1 561 # Start-TranscriptIfSupported -Path $logPath -Name $logName -NewLog |
OK, my first guess was that in your image you used an older version of PowerShell, which is clearly not the case. Given that you are using 5.1, it is really, really strange because we had a similar bug in the past with the logging: issue #40. I think the error starts here in the main script (line 55+):
However, after the above mentioned bug was identified, I tried my best to work around it. Somehow this does not work for your system, so it would be great if you copy back the original MPSXM.psm1, and start the script with the verbose switch ( Hopefully the additional output there can help me to understand what is not working. |
I have the same problem, it can not resolve $env:TEMP, so I have set it static to c:\windows\temp |
I will do that tomorrow at work and then post the result, thanks for all the help. |
Hmm, the problem with $env:TEMP again? I thought I had solved this already, but it seems not to be the case. @hanfelt After the verbose run, please also check what PS returns for |
@hanfelt Any updates? |
@texhex I tried yesterday and put the original file back but forgot to untick continue on error in the task sequence sorry ;) Then we got alot of other work to do so i couldnt continue, im off work today and might be home tomorrow as well (sick kids). I will do this first thing in the morning when im back. sorry for this delay |
No problem, take your time. I just wanted to make sure this isn't stalled. All the best for your kids! |
Thank you, and that's really the worst possible outcome for a log function to cause the entire script to die on the spot. Let me check tomorrow why logPath could be empty and how to workaround it. |
I updated the script and hopefully this bug is now fixed. I have the possible explanations what is happening here:
Finally, the Start-Transscript*() functions already had verbose output to know what they are doing, but this was not used by BIOS Sledgehammer when starting it with the Please do the following:
I really hope it will work this time. |
@datagutten Your issue with $env:TEMP will be checked once the issue for @hanfelt is fixed. If this new version works, it would be great if you could execute it on your system and attach the verbose log to a new issue. |
@texhex Will try this out tomorrow and get back to you with the result. |
Thanks for the update and sorry to hear that it still not work. A screenshot of the lower part (below the importing functions stuff) where the "real" verbose message begin might help me to understand why it still fails. |
Seems like it works i tried running it manually and it runs fine. It writes logs to C:\Windows\Temp as well |
Very good, but when run manually, the entire code that tries to read the data from SCCM is skipped, so there might still be an issue (just saying). If possible, it would be great if you could give it a test run in SCCM, as you said it didn't run OK for your colleagues. |
Still having to battle the other issue im really sorry for this ;) I just did i quick run today and thought it might be something else bugging out in the task sequence i did hit f8 and ran it from there and it worked. I didnt have time to do more today. Will look into this on monday next time Sorry! |
No problem, thanks for the update. |
Sorry for the late update @texhex , but i think everything works as it should, thanks alot for your help on this issue. Have a great weekend. |
You are welcome, thanks for the update. Here's hope that this will be the last time we need to fix an error in logging. I will close the issue now. |
Hi there when trying to run Sledgehammer from task sequence it always fails for me. Tried making package, run command, run powershell about everything you can think of. If i hit F8 and run it manually from command i get this error:
Start-TranscriptIfSupported: Cannot validate argument on parameter 'Path'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
At MPSXM.psm1:561 char:9
Start-TranscriptIfSupported - Path $logPath -Name $logName -Ne ....
The text was updated successfully, but these errors were encountered: