Quantcast
Channel: Configuration Manager 2012 - Application Management forum
Viewing all articles
Browse latest Browse all 4762

method invocation failed because does not contain a method named substring

$
0
0

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



Viewing all articles
Browse latest Browse all 4762

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>