Trying to Scan my SFTP Server for a file uploaded in the last 60 mins
Hello,
Im trying to scan my SFTP server for any file thats been uploaded in the last 60 mins.
So Far I have:
I keep getting an error
Im fairly new with scripting and powershell in general so any suggestions anyone has would help greatly.
Im trying to scan my SFTP server for any file thats been uploaded in the last 60 mins.
So Far I have:
# Set credentials to a PSCredential Object. $credential = Get-Credential # Create a WinSCP Session. $session = New-WinSCPSession -Hostname xxxxxxx -Credential $credential -SshHostKeyFingerprint ""ssh-ed25519 255 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"" # Using the WinSCPSession, show files in the directory. Get-WinSCPChildItem -WinSCPSession $session -Path /sftperic # Remove the WinSCPSession after completion. Remove-WinSCPSession -WinSCPSession $session
New-WinSCPSession : A parameter cannot be found that matches parameter name 'Hostname'. At line:5 char:30 + $session = New-WinSCPSession -Hostname xxxxxxx -Credential $cre ... + ~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [New-WinSCPSession], ParameterBindingException + FullyQualifiedErrorId : NamedParameterNotFound,New-WinSCPSession Get-WinSCPChildItem : Missing an argument for parameter 'Path'. Specify a parameter of type 'System.String[]' and try again. At line:8 char:45 + Get-WinSCPChildItem -WinSCPSession $session -Path + ~~~~~ + CategoryInfo : InvalidArgument: (:) [Get-WinSCPChildItem], ParameterBindingException + FullyQualifiedErrorId : MissingArgument,Get-WinSCPChildItem