I seem to be getting an error on the script. I am not sure of the syntax and where to add that into the script. I tried a couple of different places and got this error.
Session.SessionLogPath : The term 'Session.SessionLogPath' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\it.info\winscp.ps1:3 char:1
+ Session.SessionLogPath = "C:\it.info\script.log"
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Session.SessionLogPath:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Exception calling "Open" with "1" argument(s): "Authentication failed.
Authentication log (see session log for details):
Using username "montgomerycnty_sftp".
Access denied.
Authentication failed."
At C:\it.info\winscp.ps1:18 char:5
+ $session.Open($sessionOptions)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : SessionRemoteException
Session.SessionLogPath : The term 'Session.SessionLogPath' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\it.info\winscp.ps1:3 char:1
+ Session.SessionLogPath = "C:\it.info\script.log"
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Session.SessionLogPath:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Exception calling "Open" with "1" argument(s): "Authentication failed.
Authentication log (see session log for details):
Using username "montgomerycnty_sftp".
Access denied.
Authentication failed."
At C:\it.info\winscp.ps1:18 char:5
+ $session.Open($sessionOptions)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : SessionRemoteException