Thank you for the quick reply! After updating the script, I now get:
At C:\vSphere_Scripts\Get_VM_Apps.ps1:32 char:1
+ }
+ ~
Unexpected token '}' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : UnexpectedToken
I also tried just pasting the script into the command line, and although I did get errors, I got prompted for the guest and host credentials of each and every VM. I went through that, just clicking enter on the last 2, assuming it was going through the list of VMs in alphabetical order, because the last 2 VMs are Linux. After doing that, I did not get a report.csv file, I just got the following for each VM:
WARNING: Parameter 'HostCredential' is obsolete. The HostCredential parameter of Invoke-VMScript cmdlet is deprecated
and is ignored on VC version 4.0 onwards
Invoke-VMScript : 3/28/2024 4:54:18 PM Invoke-VMScript Value cannot be found for the mandatory parameter ScriptText
At line:3 char:14
+ ... $progs = Invoke-VMScript -VM $vm -ScriptText $progList -GuestCrede ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Invoke-VMScript], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.InvokeVmScript
You cannot call a method on a null-valued expression.
At line:4 char:5
+ $progs.Split("`n") | Select @{N="VM";E={$vm.Name}},
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull