Create a Virtual Business Card Using PowerShell & Graph API (Part 2)


This is Part Two of three. In this post, I'll outline using PowerShell with the SharePoint PnP module to upload the VCards we created in Part One. Go back and read part one and get the VCard creation script on my GitHub account. 


1) Run the 'Create_VCard' script in Part One. 

2) You'll need a SharePoint Document Library to store the VCards. The cards are saved in a '.vcf' file format from the VCard creation script. I'll walk through how to create SharePoint Document Library below.

3) You can get a copy of my Upload_Vcf_To_SharePoint script on my GitHub Account. You'll need to install the SharePoint PnP module. The module includes a handy cmdlet called 'Add-PnPFile' that does the heavy lifting of moving the .vcf files to the Document Library.

Create a SharePoint Document Library
This is pretty straightforward, but I had to look it up, so I thought I'd include the steps I used.

First, open a SharePoint site. Go to 'Site Content' on the left side navigation:

On the 'Site Contents' page, at the top of the page find the '+ New' drop down menu. Select 'Document library' from the menu.

Lastly, fill out the info for your Document Library and click 'Create.'

Once you modify the script for your environment, you can run the script to move the VCards to your Document Library in SharePoint. 

That'll do it for Part Two. In Part Three, I'll cover the Form and Flow I used to send the VCards in SharePoint as an attachment via email.