Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Powershell .NET Create an Array of files from Remote Dir

The param keyword allows overriding the variable value on command-line. Refer to PowerShell manuals.
jesc516

Powershell .NET Create an Array of files from Remote Dir

how would i go about creating an array of files from the remote directory once i am logged in?

this is what i want to do, but on the remote side.

$YYMD = ((Get-Date).AddDays(-1).ToString("yyyyMMdd"))


$arr = Get-ChildItem | Where-Object { ($_.name -match "ASSIGNMENTS_" + $YYMD + "*") -or ($_.name -match "PAYMENTS_" + $YYMD + "*") }

foreach ($a in $arr)
{
    ### Download files
}


the asterisk is there because that part of file name is a time stamp. the time is random.

would this be the most efficient method or is there a better alternative?

any help is greatly appreciated..