Forum Discussion
Feb 28, 2014
After a few attempts I finally understood your dilemma. When reading from a file you get a System.Object array.
Converting this to a string removes the line breaks.
Try this:
$def = (Get-Content iRuleContent.txt) -join "`n"
$RuleDefinition = New-Object -TypeName iControl.LocalLBRuleRuleDefinition $RuleDefinition.rule_name = "iRulewithlines" $RuleDefinition.rule_definition = $def $f5.LocalLBRule.create($RuleDefinition )