Please can somebody help me to solve the following task in powershell. May be that i am not experienced enough in powershell to find the right way in solving the following complex task.
I am searching methods and code snippets in powershell, which will help me to detect double entries in different ini-file sections, as shown (one match) in example ini-file listed below. When i have found matches i want to eliminate the complete redundant sections, except one that should be left untouched.
Search criteria: Always when both of the keys UserGroup and in the keys Arguments= have similar entries in different sections, (entries marked underlined) (occuring in different sections SASIMAP and SASOLAP), then the complete redundant sections should be deleted.
[SASIMAP]
FileName=C:\Program Files (x86)\VBScript\CScript.exe
Arguments="C:\Windows\Application Compatibility Scripts\Logon\SASEGUIDEADM4.vbs" //B //NoLogo //T:60
UserGroups=Domainname\gl_w_SASIMAP
Description=SASIMAP
Wait=0
WindowStyle=1
[SASOLAP]
FileName=C:\Program Files (x86)\VBScript\CScript.exe
Arguments="C:\Windows\Application Compatibility Scripts\Logon\SASEGUIDEADM4.vbs" //B //NoLogo //T:60
UserGroups=Domainname\gl_w_SASIMAP
Description=SASOLAP
Wait=0
WindowStyle=1
Has somebody an idee or example code to solve this task ?