Solved

Trouble running Powershell Script

Posted on 2016-09-21
5
56 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 42

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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Enabling the Skype for Business Meeting Scheduler in Hybrid OWA
Microsoft is moving in-place eDiscovery & hold from ECP to EOP console under Content Search in Search and Investigation Options.  In this post, I will be showing you how to export emails to a PST file using the Content Search Options.
Microsoft Office Picture Manager has a Picture Shortcuts pane that shows a list with the Recently Browsed folders. While creating my video Micro Tutorial here at Experts Exchange showing How to Install Microsoft Office Picture Manager in Office 2013…
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 …

632 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