Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Trying to write an answer to a CSV file.

$
0
0

Hello,

I'm trying to write "Not Found" or "Exists" to output to a CSV file.

How do you do that ?

 

Clear-Host
get-content c:\temp\servers_smalltest.txt |ForEach-Object {$_
$MachineName = $_                                                                           
 $reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $MachineName)        
 $regKey= $reg.OpenSubKey("SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0")     
 if ($regKey -eq $null){echo "Not Found"} else {echo "Exists"}} |select-Object $MachineName,?|Export-CSV -append -path c:\temp\ssl3.0.csv -NoTypeInformation -Encoding UTF8


Viewing all articles
Browse latest Browse all 6937

Trending Articles