powershell create ini file remotely -


i trying create script create ini file via powershell disable windows uac.

$functiontext = @"`[options`] updatekey=04/28/2015 12:50:27 window_left=258 window_top=149 window_width=666 window_height=519 window_max=0 backupdir=c:\windows\system32 updatecheck=1 language=1033 (app)sun java=false newversion=5.05.5176 skipuac=1 finderinclude1=path|c:\|*.*|recurse finderinclude2=path|d:\|*.*|recurse finderincludestates=1|1 see skipuac=1 showcleanwarning=false showfirefoxcleanwarning=false wipefreespacedrives=c:\ runics=0 cookiestosave=*.piriform.com|google.com "@  new-item c:\program files\ccleaner\ccleaner.ini -type file -force -value $functiontext 

i keep getting unrecognized token in source text. @ c:\progra~3\beanyw~1\scripts\2480_c~1\~sc52f~1.ps1:1 char:17 + $functiontext = <<<< @"[options] + categoryinfo : parsererror: (:) [], parseexception + fullyqualifiederrorid : unrecognizedtoken

i tried adding escape character around options see if - think issue around word [options]

if want use here-string, put @" on line itself.

$functiontext = @" [options] updatekey=04/28/2015 12:50:27 window_left=258 window_top=149 window_width=666 window_height=519 window_max=0 backupdir=c:\windows\system32 updatecheck=1 language=1033 (app)sun java=false newversion=5.05.5176 skipuac=1 finderinclude1=path|c:\|*.*|recurse finderinclude2=path|d:\|*.*|recurse finderincludestates=1|1 see skipuac=1 showcleanwarning=false showfirefoxcleanwarning=false wipefreespacedrives=c:\ runics=0 cookiestosave=*.piriform.com|google.com "@  new-item "c:\program files\ccleaner\ccleaner.ini" -type file -force -value $functiontext 

the advantage of here-string don't have escape inside string. if there single or double quotes wouldn't matter. long literal string '"@' doesn't exist, on line itself, inside ini file code you're safe.

read more here-strings.

also, shown in sample above, need put quotes around file path.