Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Trouble running Powershell Script

Posted on 2016-09-21
5
Medium Priority
?
65 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:Anthony K O365
  • 4
5 Comments
 
LVL 44

Accepted Solution

by:
Vasil Michev (MVP) earned 2000 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:Anthony K 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:Anthony K 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:Anthony K O365
ID: 41809135
Once again, I apologize. I have also supply the Input file. Thanks!!
0
 

Author Closing Comment

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

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Microsoft has changed the look and feel of Azure AD and Microsoft account sign-in pages so that you will have a more unified look and feel when moving between the two interfaces.
If something goes wrong with Exchange, your IT resources are in trouble.All Exchange server migration processes are not designed to be identical and though migrating email from on-premises Exchange mailbox to Cloud’s Office 365 is relatively simple…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

885 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