Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

running a ps1 creating a dos bat named after client computer then run the batch

I have a ps1 file containing this

 

Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Where-Object {$_.DisplayName -match "Autodesk" } | Select-Object -Property UninstallString | out-file -FilePath "\\svt-pdq01\c$\$env:COMPUTERNAME.bat"

 

 

what I am trying is to dump out all the uninstall commands autodesk products so i can get all the dosbatch commands create the machine labeled batch file then run the batch

 

here is the error I get

ScriptHalted
At C:\Windows\AdminArsenal\PDQDeployRunner\service-1\exec\Error Handling Wrapper.ps1:58 char:2
+     Throw $_.Exception.ErrorRecord
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], RuntimeException
    + FullyQualifiedErrorId : ScriptHalted
 

1

Comments

3 comments
Date Votes
  • Could it have something to do with writing the .bat file(s) to the admin share c$ on svt-pdq01?

    1
  • Rob,

    That error message indicates an issue on line 58, could we see the whole script so that we can better understand how this line fits into it?

    1
  • Hi Guys, I'm having this same error happen with a simple two line powershell to remove the Task View Button. Works fine if I run it on the machine, but fails when I push via pdq.

    1