I am trying to write a form that retires applications in sccm.
The only problem left is that I also want to remove the software on a shared location, but the application name and the software foldername is a bit different. Thje software name is for example TEST_ADB_READER_11_01 but the folder names are always the same except for the _01. So I added this to the script:
#move the software directory
$ShortRApp = ([string]$RetiringApp.Substring(0,$RetiringApp.length-3))try {
Move-Item -Path \\servername\CMContent\Software\$ShortRApp -Destination \\servername\CMContent\Software\Retired
} catch { }
Update-Log "Moved Files to Retired folder"
The result is always method invocation failed because does not contain a method named substring....
Any ideas are appreciated