Powershell Missing statement block after if

Question:

I have the follow code. But there is a {[( )]} missing somewhere. I can’t find it.
I is in the ‘if section. But I dont know why it isnt working
If someone can give a tip or something is it will be create.

Thanks for reading.

Answer:

In PowerShell, all if-statements need braces to enclose their bodies. Below is a demonstration:


Therefore, the if-statement section of your script should look like this:

Source:

Powershell Missing statement block after if by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply