Thanks Jonas,
How eveer, am trying this from Cas server with all permission , but getting the below error:
My Primary SITE code is CHN
PS E:\SW2Intune> .\Invoke-ConfigMgrAppMigrationToIntune.ps1 -Step1GetConfigMgrAppInfo -Sitecode 'CHN' -Providermachinename 'LTCH-5CD202BRWF.contoso.com -ExportFolder 'D:\SW2Intune\Output'
Start of script
Export folder: "D:\SW2Intune\Output" does not exist. Will be created...
Will create export folder: "D:\SW2Intune\Output\Tools"
Will create export folder: "D:\SW2Intune\Output\AppDetails"
Will create export folder: "D:\SW2Intune\Output\Icons"
Will create export folder: "D:\SW2Intune\Output\Scripts"
Will create export folder: "D:\SW2Intune\Output\Win32Apps"
Start of main script
Export will be made to folder: D:\SW2Intune\Output
Will get list of ConfigMgr apps
Could not connect to ConfigMgr SMSProvider
Invalid namespace