I am exporting drive name movies in text file.
Get-WmiObject win32_logicaldisk| foreach-object {$volumename -Match "movies" } | select movies > c:\nn.txt
And later comparing it but not successful always getting false result can anyone help?
$test=Get-WmiObject win32_logicaldisk| foreach-object {$volumename -Match "movies" } | select movies > c:\nn.txt
$array =get-content c:\nn.txt
$real= Get-WmiObject win32_logicaldisk| foreach-object {$volumename -Match "movies"} | select movies
If ($array -eq $real)
{write-host "it was success" -foregroundcolor blue}
Else {write-host "it was fail" -foregroundcolor green}
1 Answers