I am using the following script to compare values between two files:
#--beginning of powershellscript compare.ps1
param([string]$nodeA = "nodeA", [string]$nodeB = "nodeB", [string]$hanode = "hanode")
Add-Content "List of Non-Synchronized Users in HA Cluster $hanode"
compare-object (get-content $nodeA) (get-content $nodeB)
#--end of powershell
I want to use command prompt to send the name of files like this and get output in a file:
powershell.exe -File compare.ps1 -nodeA "mynodeA.txt" -nodeB "mynodeB.txt" -hanode "mycentralnode" -Out-File Output.txt -append
When I run the command in command prompt I get this error:
cmdlet Add-Content at command pipeline position 1
Supply values for the following parameters:
Please let me know how to fix the powershell script and the command prompt parameter passing so that it takes those two text files as input and display the Add-Content properly
Thank You so much and appreciate your help!!