Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1748

Community Plugins & Addons • Powershell problem

$
0
0
Well, I'm back lol. This time I'm experimenting on creating meters using PowerShell.
When I run this code in PowerShell it works, it writes the lines correctly, but if I do it in Rainmeter it doesn't.
Code:

Code:

(Get-Content "test.ini" -Raw) + "`r`n[Meter5] `r`nMeter=Shape `r`nMeterStyle=Meterstyle" | Set-Content "test.ini"
log.txt

Code:

On line: 1 Character: 30+ (Get-Content send.ini -Raw) + `r`n[Meter5] `r`nMeter=Shape `r`nMeterS ...+                                ~You must provide a value expression after the '+' operator.On line: 1 Character: 31+ (Get-Content send.ini -Raw) + `r`n[Meter5] `r`nMeter=Shape `r`nMeterS ...+                                ~~~~~~~~~~~~Unexpected token '`r`n[Meter5]' in the expression or statement.    + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException    + FullyQualifiedErrorId : ExpectedValueExpression
The problem seems to be with "+" and "`r`n". If I take them out it works but it writes everything in the same line including `r`n. Should I use some specific syntax for this case?.

This is the measure:

Code:

[Add]Measure=PluginPlugin=RunCommandProgram=PowerShell  Parameter=(Get-Content "test.ini" -Raw) + "`r`n[Meter5] `r`nMeter=Shape `r`nMeterStyle=Meterstyle" | Set-Content "test.ini"State=HideOutputType=UTF8OutputFile=log.txt

Statistics: Posted by RicardoTM — Today, 2:59 am



Viewing all articles
Browse latest Browse all 1748

Trending Articles