Forum Discussion
Jeffrey_Silver1
Nimbostratus
Feb 26, 2014iRule content show up in one line
When I create an iRule from a powershell script that includes HTTP content, the irule gets created, however, the HTTP is not delimited in the rule when you look at. Its all on one line. Is there an...
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 )
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects