Solved

Trouble running Powershell Script

Posted on 2016-09-21
5
42 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:K Anthony O365
  • 4
5 Comments
 
LVL 40

Accepted Solution

by:
Vasil Michev (MVP) earned 500 total points
ID: 41809035
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:K Anthony O365
ID: 41809074
For some reason it's not asking for the -logfile parameter nor the path where the csv file is located.
0
 

Author Comment

by:K Anthony O365
ID: 41809130
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:K Anthony O365
ID: 41809135
Once again, I apologize. I have also supply the Input file. Thanks!!
0
 

Author Closing Comment

by:K Anthony O365
ID: 41809136
thanks!!
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
Read this checklist to learn more about the 15 things you should never include in an email signature.
how to add IIS SMTP to handle application/Scanner relays into office 365.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

770 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