• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 76
  • Last Modified:

Trouble running Powershell Script

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

I'm wanting to run the attached PS Script to remove certain folders in Office 365 OneDrive for Business. Any thoughts?
Anthony K O365
Anthony K O365
  • 4
1 Solution
Vasil Michev (MVP)Commented:
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

Anthony K O365Author Commented:
For some reason it's not asking for the -logfile parameter nor the path where the csv file is located.
Anthony K O365Author Commented:
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.
Anthony K O365Author Commented:
Once again, I apologize. I have also supply the Input file. Thanks!!
Anthony K O365Author Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

WEBINAR: GDPR Implemented - Tips & Lessons Learned

Join the WatchGuard team on Thursday, March 29th as we recount some valuable lessons learned in weighing the needs of a business against the new regulatory environment, look ahead at the two months left before implementation, and help you understand the steps you can take today!

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now