param(
[string]$cFilename="DT_VendorList",[string]$cSERVERNAME="ocsql23",[string]$cDBNAME="DY2025"
)

#Specify variables and pass parameters and specify format of report PDF (to keep things simple)
$url = "http://ocsql23/ReportServer/Pages/ReportViewer.aspx?/GATCSReports/DT_VendorList&ReportSvr="+$cSERVERNAME+"&ReportDB="+$cDBNAME+"&rs:Format=excel"
$url

$webclient = New-Object System.Net.WebClient
$webclient.UseDefaultCredentials = $TRUE

$file = "\\ocsql23\tco\gatcs\exports\DT_Vendor\"+$cFilename+".xls"
$webclient.DownloadFile($url,$file)
