The cred xml file is under C:/util/scripts/creds so should be accessible. Here is the script to:
#############################
# Connect to vCenter #
#############################
Import-Module VMware.VimAutomation.Core
$vc = 'vcenter6.ruralnex.com'
$Cred = Import-Clixml C:\util\scripts\Creds\mycreds-Thin.xml
Connect-VIServer $VC -Credential $Cred
#############################
# Variables #
#############################
$date=Get-Date -format "yyyy-MMM-d"
$datetime=Get-Date
$filelocation="C:\util\Scripts\Temp\Thin-$date.htm"
#############################
# Content #
#############################
$report = Get-VM | Get-HardDisk |
where {$_.StorageFormat -ne "Thin"} |
select Parent,StorageFormat,Filename
#############################
# Add Text to the HTML file #
#############################
$report | ConvertTo-Html -title "VMware Thin Provision Check" -body "<H1>Vmware Thin Provision Check</H1>" -head "<link rel='stylesheet' href='style.css' type='text/css' />" | Out-File $filelocation
ConvertTo-Html -title "VMware Thin Provision Check" -body "<H4>Date and time </H4>",$datetime -head "<link rel='stylesheet' href='style.css' type='text/css' />" | Out-File -Append $filelocation
ConvertTo-Html -title "VMware Thin Provision Check" -body "<H4>VM Count</H4>",$report.Count -head "<link rel='stylesheet' href='style.css' type='text/css' />" | Out-File -Append $filelocation
######################
# FTP HTML output #
#####################
#we specify the directory where all files that we want to upload
$Dir="$filelocation"
#Below for test
#$Dir="C:/Users/administrator/Desktop/tmp/"
#ftp server
$ftp = "ftp://10.10.25.240/internal-backups/datacenter/vcenter/misc-reports/Thin/"
$user = "internal-ftp-backup"
$pass = "<PW>"
$webclient = New-Object System.Net.WebClient
$webclient.Credentials = New-Object System.Net.NetworkCredential($user,$pass)
#list every sql server trace file
foreach($item in (dir $Dir "*.bak")){
"Uploading $item..."
$uri = New-Object System.Uri($ftp+$item.Name)
$webclient.UploadFile($uri, $item.FullName)
}
##############################
# Disconnect session from VC #
##############################
disconnect-viserver -confirm:$false