New to Powershell:
I have to run a command from the CMD prompt because it will not work in Powershell. I think I understand how to run it from the CMD prompt by using "cmd /c"? I tested my script on a test machine with a simple "Hostname" command and it worked, but when I try it from the server with the actually command it does not work. I'm confused how to first navigate to the folder to run the command in Powershell. What am I missing? Here is what I tried, but I'm getting an error and the command wont run.
I'm sure it is something simple that I am missing
=====
$var = (cmd /c "C:\Program Files (x86)\nCipher\nfast\bin>anonkneti xxx.xxx.xxx.17")
cmd /c "C:\Program Files (x86)\nCipher\nfast\bin>anonkneti xxx.xxx.xxx.17"
If($var.length -eq 55)
{
Write-EventLog –LogName "Application" –Source “Cipher" –EntryType "Information" –EventID 9999 -Message "Connection Successful"
}
Else
{
Write-EventLog –LogName "Application" –Source “Cipher” –EntryType "Error" –EventID 9998 -Message "Error - RemoteServerFailed"
}
======
Thank you kindly!