Tech Quip: Allowing Office 365 Sharepoint Sharing Outside of Organization

Original source:
http://itgroove.net/brainlitter/2017/06/01/enable-guest-folder-file-sharing-office-365-group-files/

https://www.microsoft.com/en-ca/download/details.aspx?id=35588

$adminUPN="replace_with_username"
$orgName="name_of_sharepoint_prefix"
$usercredential = Get-Credential -username $adminUPN -Message "type password"
Connect-SPOService -Url https://$orgName-admin.sharepoint.com -Credential $userCredential
$siteurl="https://$orgName.sharepoint.com/sites/desired_site_collection"
set-sposite -identity $Siteurl -sharingcapability ExternalUserAndGuestSharing