Skip to content
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

Error running script in MDT deployment #159

Open
joebananas10 opened this issue Nov 21, 2024 · 3 comments
Open

Error running script in MDT deployment #159

joebananas10 opened this issue Nov 21, 2024 · 3 comments

Comments

@joebananas10
Copy link

joebananas10 commented Nov 21, 2024

During a MDT deployment,k to a newly imaged computer i get multiple errors. The error items below are from the BDD.log file. I end up with these errors when the script is run with the following commandline option, -RunDefaults -Sysprep -Silent

The last error which references the line "+ reg import "$PSScriptRoot\Regfiles$path"" repeats multiple times.

+ if ((Get-AppxPackage -Name "*Microsoft.DesktopAppInstaller*") -and (( ...
+      ~~~~~~~~~~~~~~~]LOG]!><time="16:55:14.000+000" date="11-20-2024" component="TaskSequencePSHost" context="" type="3" thread="" file="TaskSequencePSHost">
<![LOG[NotSpecified: (:) [], TypeInitializationException]LOG]!><time="16:55:14.000+000" date="11-20-2024" component="TaskSequencePSHost" context="" type="3" thread="" file="TaskSequencePSHost">
<![LOG[Exception calling "SetBufferContents" with "2" argument(s): "The method or operation is not implemented."]LOG]!><time="16:55:14.000+000" date="11-20-2024" component="TaskSequencePSHost" context="" type="3" thread="" file="TaskSequencePSHost">
<![LOG[At line:4 char:1
+ $RawUI.SetBufferContents(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~]LOG]!><time="16:55:14.000+000" date="11-20-2024" component="TaskSequencePSHost" context="" type="3" thread="" file="TaskSequencePSHost">
<![LOG[NotSpecified: (:) [], MethodInvocationException]LOG]!><time="16:55:14.000+000" date="11-20-2024" component="TaskSequencePSHost" context="" type="3" thread="" file="TaskSequencePSHost">
<![LOG[The operation completed successfully.]LOG]!><time="16:55:50.000+000" date="11-20-2024" component="TaskSequencePSHost" context="" type="3" thread="" file="TaskSequencePSHost">
<![LOG[At \\HCAWDS05\DeploymentShare$\Scripts\HCA_Scripts\23H2-01\Win11Debloat\Win11Debloat.ps1:529 char:9
+         reg import "$PSScriptRoot\Regfiles\$path"
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]LOG]!><time="16:55:50.000+000" date="11-20-2024" component="TaskSequencePSHost" context="" type="3" thread="" file="TaskSequencePSHost">
<![LOG[NotSpecified: (The operation completed successfully.:String) [], RemoteException]LOG]!><time="16:55:50.000+000" date="11-20-2024" component="TaskSequencePSHost" context="" type="3" thread="" file="TaskSequencePSHost">
<![LOG[]LOG]!><time="16:55:50.000+000" date="11-20-2024" component="TaskSequencePSHost" context="" type="3" thread="" file="TaskSequencePSHost">
<![LOG[At \\HCAWDS05\DeploymentShare$\Scripts\HCA_Scripts\23H2-01\Win11Debloat\Win11Debloat.ps1:529 char:9
+         reg import "$PSScriptRoot\Regfiles\$path"
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]LOG]!><time="16:55:50.000+000" date="11-20-2024" component="TaskSequencePSHost" context="" type="3" thread="" file="TaskSequencePSHost">
<![LOG[NotSpecified: (:String) [], RemoteException]LOG]!><time="16:55:50.000+000" date="11-20-2024" component="TaskSequencePSHost" context="" type="3" thread="" file="TaskSequencePSHost">
<![LOG[The operation completed successfully.]LOG]!><time="16:55:50.000+000" date="11-20-2024" component="TaskSequencePSHost" context="" type="3" thread="" file="TaskSequencePSHost">
<![LOG[At \\HCAWDS05\DeploymentShare$\Scripts\HCA_Scripts\23H2-01\Win11Debloat\Win11Debloat.ps1:529 char:9
+         reg import "$PSScriptRoot\Regfiles\$path"```
@Raphire
Copy link
Owner

Raphire commented Nov 21, 2024

Heya,

I edited your comment to format the error message better.

From the logs it seems like importing the registry files worked as intended. It shows The operation completed successfully.. Which is what it would print when run normally.

Not sure about the first error referencing Get-AppxPackage though.

Are the changes not applying as expected? If so, what changes specifically are not working?

@joebananas10
Copy link
Author

Some changes are definitely implemented but I don't know what's missing. I can't tell what the " ((Get-AppxPackage -Name "Microsoft.DesktopAppInstaller") " line is applying to, to know if I'm missing anything.

Can you add a command line option to suppress the "The operation completed successfully" messages? I think I remember that in powershell it's possible to pipe the output of a command to null to suppress messages. are you familiar with that?

Do you have any thoughts on the error line that reads "[Exception calling "SetBufferContents" with "2" argument(s): "The method or operation is not implemented."". That seems like a powerhell version problem to me but I'm not able to change the powershell version of my WDS servers. They are all running Server 2019, and have PS version 5.1.26100.1

Lastly, unrelated to the error message but it seems the -RunDefaults command line parameter may be also including the -ClearStartAllUsers or -ClearStart options. is there a way to prevent this?

@Raphire
Copy link
Owner

Raphire commented Nov 29, 2024

Some changes are definitely implemented but I don't know what's missing. I can't tell what the " ((Get-AppxPackage -Name "Microsoft.DesktopAppInstaller") " line is applying to, to know if I'm missing anything.

This line is trying to check if Winget is installed.

Can you add a command line option to suppress the "The operation completed successfully" messages? I think I remember that in powershell it's possible to pipe the output of a command to null to suppress messages. are you familiar with that?

I suppose this is possible. I'll have to look into this, as this message is useful to ensure the registry operation completed correctly.

Do you have any thoughts on the error line that reads "[Exception calling "SetBufferContents" with "2" argument(s): "The method or operation is not implemented."". That seems like a powerhell version problem to me but I'm not able to change the powershell version of my WDS servers. They are all running Server 2019, and have PS version 5.1.26100.1

I think you're right, not sure what can be done to fix this though. Windows Server is a whole different beast, a lot of components are not installed by default or are running an older stable version.

Lastly, unrelated to the error message but it seems the -RunDefaults command line parameter may be also including the -ClearStartAllUsers or -ClearStart options. is there a way to prevent this?

That's strange, I double-checked the code and this definitely isn't the case. What's the issue you're running into?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants