reg.exe throws an error on success in remote session This topic contains 6 replies, has 2 voices, and was last updated by GS 4 weeks, 1 day ago. Author Posts January 22, 2018 at 5:37 pm #91961 GSParticipant Hello, Seeing oddity below when executing reg.exe remotely. Despite message that it's completed successfully it still throws an error PS C:\Users\admin> Enter-PSSession containerhost1 [containerhost1]: PS C:\Users\admin\Documents> reg export hklm\software\odbc\odbc.ini a.reg The operation completed successfully. [containerhost1]: PS C:\Users\admin\Documents> reg import a.reg reg : The operation completed successfully. + CategoryInfo : NotSpecified: (The operation completed successfully.:String) , RemoteException + FullyQualifiedErrorId : NativeCommandError January 22, 2018 at 5:38 pm #91964 Don JonesKeymaster Is the second one attempting to write to HKCU, by chance? January 22, 2018 at 5:39 pm #91966 GSParticipant No. I exported something from HKLM in `reg export` right above it. January 22, 2018 at 5:40 pm #91969 Don JonesKeymaster Ah, gotcha. It's probably still HKCU related, because you don't get a proper HKCU in a remote session. It's likely reg.exe is just hardcoded to do something that isn't going to work in that context. January 22, 2018 at 5:41 pm #91972 GSParticipant The problem that it throws an error at all, so when I build docker images it breaks the flow, how do I structure powershell call that no stderror is returned? January 22, 2018 at 5:42 pm #91975 Don JonesKeymaster Huh. You could try redirecting the error pipeline into the success pipeline, and then piping the command to Out-Null. That should keep anything out of stderr. January 22, 2018 at 5:43 pm #91978 GSParticipant Thanks. This works reg import a.reg *>&1 | out-null Author Posts You must be logged in to reply to this topic.