I am trying to get a Powershell script to run. It has an if block. When I keep the code block it executes on the same line like this...
If ($DirExists -eq $True) {New-Item ($DefaultPath + "\" + $DateCode) -Type Directory}
It executes fine. But I need to execute a few more lines so I tried this...
If ($DirExists -eq $True) {
New-Item ($DefaultPath + "\" + $DateCode) -Type Directory
}
and I get the prompt of....
>> New-Item ($DefaultPath + "\" + $DateCode) -Type Directory
>>}
I need to execute more than one line in the If statement.
Any ideas?
Thanks
If ($DirExists -eq $True) {New-Item ($DefaultPath + "\" + $DateCode) -Type Directory}
It executes fine. But I need to execute a few more lines so I tried this...
If ($DirExists -eq $True) {
New-Item ($DefaultPath + "\" + $DateCode) -Type Directory
}
and I get the prompt of....
>> New-Item ($DefaultPath + "\" + $DateCode) -Type Directory
>>}
I need to execute more than one line in the If statement.
Any ideas?
Thanks