Test/FileSystem/CreateAndDeleteDirectory.ps1


Import-Module CmxModule -Force

$directoryPath = "C:\Temp\Test Directory[$]"
if(!(ExistsDirectory($directoryPath)))
{
    Write-Output "The directory does not exist. Create it now."
    CreateDirectory($directoryPath)
}

Read-Host "The directory "$directoryPath" should exist now."

if(ExistsDirectory $directoryPath)
{
    Write-Output "The directory exists. Delete it now."
    DeleteDirectory($directoryPath)
}

Read-Host "The directory "$directoryPath" should be gone now."