Skip to content

Commit f76a779

Browse files
committed
add command line parameters to powershell.exe
1 parent 270122a commit f76a779

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/puppet/provider/windowsfeature/default.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
def self.instances
2222
# an array to store feature hashes
2323
features = []
24-
result = ps(%($ProgressPreference='SilentlyContinue'; Import-Module ServerManager; Get-WindowsFeature | Select-Object -Property Name, Installed | ConvertTo-XML -As String -Depth 4 -NoTypeInformation))
24+
result = ps('-NoProfile', '-NonInteractive', '-NoLogo', '-ExecutionPolicy', 'Bypass',
25+
'-Command', "$ProgressPreference='SilentlyContinue'; Import-Module ServerManager; Get-WindowsFeature | Select-Object -Property Name, Installed | ConvertTo-Xml -As String -Depth 4 -NoTypeInformation")
2526
# create the XML document and parse the objects
2627
xml = Document.new result
2728
xml.root.each_element do |object|

0 commit comments

Comments
 (0)