# Input bindings are passed in via param block.
param($Timer)
Import-Module -name ExchangeOnlineManagement
Import-Module -name PnP.PowerShell
$UserName="admin@....onmicrosoft.com"
$SiteURL="https://....sharepoint.com/sites/epsogtest"
$secpasswd = ConvertTo-SecureString '...' -AsPlainText -Force
$o365cred = New-Object System.Management.Automation.PSCredential ($UserName, $secpasswd)
Connect-ExchangeOnline -Credential $o365cred
Register-PnPManagementShellAccess -ShowConsentUrl -TenantName ....onmicrosoft.com
Connect-PnPOnline -Url $SiteURL -Credential $o365cred
$file = Get-PnPFile -Url '/sites/epsogtest/Shared%20Documents/csv.csv' -AsString
$file | ConvertTo-Csv
Import-Csv $file |%{New-MailContact -Name $_.Name -DisplayName $_.Name -ExternalEmailAddress $_.ExternalEmailAddress -FirstName $_.FirstName -LastName $_.LastName}
Import-Csv $file |%{Set-Contact -Identity $_.Name -StreetAddress $_.StreetAddress -City $_.City -StateorProvince $_.StateorProvince -PostalCode $_.PostalCode -Phone $_.Phone -MobilePhone $_.MobilePhone -Pager $_.Pager -HomePhone $_.HomePhone -Company $_.Company -Title $_.Title -OtherTelephone $_.OtherTelephone -Department $_.Department -Fax $_.Fax -Initials $_.Initials -Notes $_.Notes -Office $_.Office -Manager $_.Manager -CountryOrRegion $_.CountryOrRegion}
Disconnect-ExchangeOnline -Confirm:$false
The import-csv $file doesn’t work because it can’t find file any help please
im using azure function, powershell version 7.