I am trying to execute a powershell script from a terraform script. The powershell commands in the file is not being recognized while execution. Below is the code:
resource "null_resource" "example2" {
provisioner "local-exec" {
command = "powershell -file ./sample.ps1"
}
}
Below is the error: null_resource.example2 (local-exec): Add-AzIotHubDevice : The term 'Add-AzIotHubDevice' is not recognized as the name of a cmdlet, function, script file, or operable