Scripts and OneDrive

Welcome Forums General PowerShell Q&A Scripts and OneDrive

This topic contains 6 replies, has 3 voices, and was last updated by

 
Participant
2 weeks, 1 day ago.

  • Author
    Posts
  • #133271

    Participant
    Points: 35
    Rank: Member

    Is there a way to run a script from a OneDrive folder?

    I work both from the office and from home.   Rather than remoting into my pc at the office or having duplicate folders with duplicate sets of scripts which I sometimes forget to update, it would be nice to be able to just have one folder with all my scripts and source files etc. on OneDrive.

    I have been unsuccessful in finding a way to map a OneDrive folder to a drive letter however.

    Any suggestions?    Flash drives are out as they are encrypted with BitLocker and using them is a royal pain.

  • #133280

    Participant
    Points: 14
    Rank: Member

    If you are using the OneDrive Sync Client, then you have a local folder to run your scripts from without the need to map it with a drive letter. I run scripts from my onedrive all the time without issue. OneDrive syncs my script folder across two machines I use for work.

    • #133287

      Participant
      Points: 35
      Rank: Member

      I have had trouble running scripts when the path is several folders long.  ie: c:\users\username\OneDrive – CompanyName, Inc.\foldername\foldername

      etc.

      I suspect it has to do with how the naming works for our OneDrive.  Literally OneDrive – CompanyName, Inc.

      So mapping the scripts folder to a drive letter would be ideal.

       

  • #133286

    Participant
    Points: 513
    Helping Hand
    Rank: Major Contributor

    Why the need to map a drive to OneDrive? OneDrive already syncs to your PC.

    Just copy all your script folder to your OneDrive folder, it sync's as expected, and using the normal map drive or New-PSDrive, you should be able to map. So, I am curious as to what you've tried that you say has failed.

    PSDrive notwithstanding, you've always been able to map a local drive to OneDrive, though doing so is a bit convoluted.
    There have been lots of articles on how to do that since Win7 days.

    Example of some:

    https://www.laptopmag.com/articles/map-onedrive-network-drive

    How to map OneDrive as Network Drive in Windows 10

    • #133292

      Participant
      Points: 35
      Rank: Member

      This is a corporate OneDrive.  Not a personal one.

  • #133293

    Participant
    Points: 513
    Helping Hand
    Rank: Major Contributor

    You can still map a drive to ODfB

    https://blog.ciaops.com/2016/03/mapping-drive-to-onedrive-for-business.html

    OneDriveMapper automatically map your OneDrive for Business upon login
    This script maps your Onedrive / Sharepoint / Teams document libraries to driveletters (or shortcuts). It can be used in any environment (VDI, RemoteApp, w10 etc).

    https://gallery.technet.microsoft.com/OneDriveMapper-automaticall-d7d498b0

    • #133301

      Participant
      Points: 35
      Rank: Member

      After reading these details:

      "...Finally, mapping has severe limitations (speed, size limits, reliability), if you need a highly available solution, Freek Berson wrote a good article "I got your OneDrive for Business Sync right here!" on using a containerized solution with the actual, full Onedrive client and experience using FSLogix. ..."

      I doubt I would use this and FLogix would have to be purchased which is not really a good fit.

      Thanks for the info though.

       

You must be logged in to reply to this topic.