adding lines to Multiple Notes.ini files with Powershell


adding lines multiple notes.ini files powershell

i have powershell script want run add 2 lines 'im_disabled' & 'im_no_setup=1' append end of each ini file.

i want run against folder h:\test\ has subfolders each containing notes.ini

i have following powershell works using -replace. i'm unable use replace , need append 2 new lines end of each ini.

 $places = 'h:\test\'
 $places |
  get-childitem -recurse -include notes.ini |
     foreach-object {
    (get-content $_)        -replace 'kittype=1', "`nkittype=1`r`nim_disabled=1`r`nim_no_setup=1" |

    set-content $_
  'processed: {0}' -f $_.fullname
 }

any appreciated



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

WMI Repository 4GB limit - Win 2003 Ent Question

Round Robin is killing performance on our network

Change home folder default permission?