'If' statement syntax [closed]

asked 2018-05-29 07:41:22 -0600

Daizy gravatar image

Hello,

I am trying to run a query that if the directory/folder is empty, only then perform certain tasks else exit out.

$abc_install = "C:\\temp\\abc\\"

    if($abc_install == '') {
        Perform
        following
        tasks
       }
else {
    exec {'ExitOut':
                provider => powershell,
                command     => 'exit 0',
            }
            }

But this line is not working -- if($nlog_install == '') { . 'else' statement is directly getting executed.

Can anyone tell me the correct syntax of 'if' statement to check if the folder/dir is empty?

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by Mr_Sharma
close date 2018-05-29 08:58:52.216249