Solved

Trouble running Powershell Script

Posted on 2016-09-21
5
35 Views
Last Modified: 2016-09-21
This is a SharePoint PS running in Windows PowerShell ISE. I get the followng error message:

Test-Path : Cannot bind argument to parameter 'Path' because it is an empty string.
At C:\Users\katadmin\Desktop\O 365 items\Remove-OneDriveForBusinessFolder.ps1:143 char:19
+         If (!(Test-Path $LogFile))
+                         ~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Test-Path], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands
   .TestPathCommand

I'm wanting to run the attached PS Script to remove certain folders in Office 365 OneDrive for Business. Any thoughts?
Remove-OneDriveForBusinessFolder.txt
0
Comment
Question by:kt KTAdmin
  • 4
5 Comments
 
LVL 38

Accepted Solution

by:
Vasil Michev (MVP) earned 500 total points
Comment Utility
Provide a value for the $logfile variable, either by running the script with the -LogFile parameter or directly inside the script. Here's an example:

.\Remove-OneDriveForBusinessFolder.ps1 -LogFile blabla.log

Open in new window

0
 

Author Comment

by:kt KTAdmin
Comment Utility
For some reason it's not asking for the -logfile parameter nor the path where the csv file is located.
0
 

Author Comment

by:kt KTAdmin
Comment Utility
Actually, after inserting the name of logfile I got pass that error. Thanks. However, it's not asking for the location of the csv file, but it's navigating throughout the entire Tenant.
0
 

Author Comment

by:kt KTAdmin
Comment Utility
Once again, I apologize. I have also supply the Input file. Thanks!!
0
 

Author Closing Comment

by:kt KTAdmin
Comment Utility
thanks!!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
"Migrate" an SMTP relay receive connector to a new server using info from an old server.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now