Here's the output of verbose:
VERBOSE: 2023/03/05 11:23:21 Get-View Finished execution
VERBOSE: 2023/03/05 11:23:21 Get-View Finished execution
VERBOSE: 2023/03/05 11:23:21 Get-View Finished execution
VERBOSE: 2023/03/05 11:23:21 Get-View Finished execution
VERBOSE: No GuestOSType value provided. Trying to determine now.
VERBOSE: It's a Linux guest OS
VERBOSE: Seems to be a Linux guest OS
VERBOSE: Add SheBang #!/usr/bin/env bash
Exception calling "CreateTemporaryDirectoryInGuest" with "5" argument(s): "Failed to authenticate with the guest operating system using the supplied credentials."
At C:\Users\redacted\Invoke-VMScriptPlus.ps1:406 char:104
+ ... oraryDirectoryInGuest($moref, $auth, "$($env:USERNAME)_$($PID)", $nul ...
+ ~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : VimException
VERBOSE: Created temp folder in guest OS
VERBOSE: Encountered a problem creating the script file in the guest OS
Exception calling "CreateTemporaryFileInGuest" with "5" argument(s): "Failed to authenticate with the guest operating system using the supplied credentials." Exception calling
"CreateTemporaryDirectoryInGuest" with "5" argument(s): "Failed to authenticate with the guest operating system using the supplied credentials."[0].Exception.Message
At C:\Users\redacted\Invoke-VMScriptPlus.ps1:423 char:17
+ Throw "$error[0].Exception.Message"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Exception calli...ception.Message:String) [], RuntimeException
+ FullyQualifiedErrorId : Exception calling "CreateTemporaryFileInGuest" with "5" argument(s): "Failed to authenticate with the guest operating system using the supplied credentials." Exception calling "CreateTemporaryDirectoryInGuest" with "5" argument(s): "Failed to authenticate with the guest operating system using the supplied credentials."[0].Exception.Message
And the vmware.log from ESX for the log:
2023-03-05T16:23:22.120Z| vmx| I125: VigorTransportProcessClientPayload: opID=20889671-d8-ebc3 seq=10866: Receiving GuestOps.CreateTemporaryDirectory request.
2023-03-05T16:23:25.095Z| vcpu-12| I125: VigorTransport_ServerSendResponse opID=20889671-d8-ebc3 seq=10866: Completed GuestOps request with messages.
2023-03-05T16:23:25.392Z| vmx| I125: VigorTransportProcessClientPayload: opID=338db5ac-c0-ebda seq=10877: Receiving GuestOps.CreateTemporaryFile request.
2023-03-05T16:23:25.865Z| vcpu-13| I125: VigorTransport_ServerSendResponse opID=338db5ac-c0-ebda seq=10877: Completed GuestOps request with messages.
From inside the guest OS (/var/log/vmware-vmsvc-root.log):
[2023-03-05T16:23:21.746Z] [ message] [vix] VixTools_ProcessVixCommand: command 182
[2023-03-05T16:23:21.746Z] [ message] [VCGA] Pref_Init: Using '/etc/vmware-tools/vgauth.conf' as preferences filepath
[2023-03-05T16:23:21.746Z] [ message] [VCGA] VGAuth 'build-15389592' initialized for application 'vmtoolsd'. Context created at 0x5565393446b0
[2023-03-05T16:23:21.747Z] [ message] [VCGA] PAM up and running.
[2023-03-05T16:23:24.652Z] [ warning] [VCGA] PAM error: Permission denied (6), mapped to VGAuth error 12
[2023-03-05T16:23:24.652Z] [ warning] [vix] VixToolsImpersonateUser: impersonation failed (3050)
[2023-03-05T16:23:24.652Z] [ message] [vix] VixToolsCreateTempFileInt: opcode 182 returning 3050
[2023-03-05T16:23:24.652Z] [ message] [vix] ToolsDaemonTcloReceiveVixCommand: command 182, additionalError = 4294967294
[2023-03-05T16:23:25.003Z] [ message] [vix] VixTools_ProcessVixCommand: command 181
[2023-03-05T16:23:25.421Z] [ warning] [VCGA] PAM error: Permission denied (6), mapped to VGAuth error 12
[2023-03-05T16:23:25.421Z] [ warning] [vix] VixToolsImpersonateUser: impersonation failed (3050)
[2023-03-05T16:23:25.421Z] [ message] [vix] VixToolsCreateTempFileInt: opcode 181 returning 3050
[2023-03-05T16:23:25.421Z] [ message] [vix] ToolsDaemonTcloReceiveVixCommand: command 181, additionalError = 4294967292