Script Success but no output

Hey ,

i run this script in PS without any problem.
when i try in Syncro i have no fault but also no Output, only a black line

what’s wrong ??

Import-Module $env:SyncroModule
function Get-DesktopShortcuts{
    $Shortcuts = Get-ChildItem -Recurse "C:\users\$env:UserName\Desktop" -Include *.lnk
    $Shell = New-Object -ComObject WScript.Shell
    foreach ($Shortcut in $Shortcuts)
    {
        $Properties = @{
        ShortcutName = $Shortcut.Name;
        ShortcutFull = $Shortcut.FullName;
        ShortcutPath = $shortcut.DirectoryName
        Target = $Shell.CreateShortcut($Shortcut).targetpath
        }
        New-Object PSObject -Property $Properties
    }

[Runtime.InteropServices.Marshal]::ReleaseComObject($Shell) | Out-Null
}
$Output = Get-DesktopShortcuts
$Output

Now i write the output first to a file and then upload to the asset
Now it works

Doesn’t work because you can’t output that type without changing it.

Change $Output to:

($Output | Format-List | Out-String)

Or remove the FL if you want, but it cuts off because of the length, but either way, that’s what you need to get it to display.