0

I have created my own module. This module executes a powershellscript.

But now I need to overgive them some variables, how can I do this.

I already have tried with this:

$data = Get-Content $args[0] | Out-String | ConvertFrom-Json

But that doesnt work.

Do you have any suggestions?

VallingSki
  • 133
  • 4

1 Answers1

1

Piping to Out-String is not necessary here. You can utilize the -Raw switch on Get-Content if you want to read file contents as a single string:

$data = Get-Content $args[0] -Raw | ConvertFrom-Json
AdminOfThings
  • 23,946
  • 4
  • 17
  • 27