Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In switching from traditional mapped drives with an assigned drive letter (for example, N:\ or R:\), there are some changes that may need to be made to the way scripts or application preferences are managed. 

Desktop Applications that require a drive letter

Once OneDrive is activated, all files can be saved via the local path located at C:\users\%username%\OneDrive - University of Waterloo\ 

Scripting with OneDrive

PowerShell is the replacement for both Command and Batch files. PowerShell provides commands that allow one to interact with OneDrive (or other M365 Cloud Storage Locations).

...

More information about using PowerShell can be found at the Microsoft Learn site 

Other Environment Variables for OneDrive 

OneDrive can also be referenced by using Microsoft-assigned variables: 

  • %OneDriveCommercial% → is used for OneDrive for Organizations' accounts. This means one can also use this in scripts: C:\users\%username%\%OneDriveCommercial%  

  • %OneDriveConsumer% → is used for OneDrive Personal accounts i.e., C:\users\%username%\%OneDriveConsumer% 

  • %OneDrive% → will usually access the first OneDrive connection – and if there is only one connection it works as well for scripting.  

Working with SharePoint Document Libraries via Scripts 

SharePoint Document Libraries can also be accessed via the OneDrive APP.  

...