Error while running powershell script - Cannot bind argument to parameter 'Path' because it is null.
Hello,
I have one script for renaming homefolders and setting ACLs. It works on my personal laptop but not at work.
Gives me this error: "Cannot bind argument to parameter 'Path' because it is null.
At :line:5 char:11
+ (Get-Item <<<< $_.ColumnA).MoveTo($_.ColumnB)"
I know its probably some settings, but I cannot manage it.
I am running PowerGui script editor ver. 2.1.1.1202 .
CSV is Comma Separated Values, your delimiter is a semi-colon.
You can either change that, or run Import-Csv like this:
Import-Csv C:\test.csv -Delimiter ";" | ....
Chris
0
90% of attacks start with a phish. It’s critical that IT admins and MSSPs have the right security in place to protect their end users from these phishing attacks. Check out our latest feature brief for tips and tricks to keep your employees off a hackers line!
You don't really want a pipeline there, you're not passing anything along. You can just use:
ren C:\A B
icacls c:\B /remove xx\yy /grant xx\yy:(OI)(CI)(M)
And the error message... well if that path doesn't exist... I can't help you with that :)
Chris
0
Radim88Author Commented:
Thanks :-) , I am an idiot. Let me ask you another question before I accept it.
ren C:\A B | icacls c:\B /remove xx\yy /grant xx\yy:(OI)(CI)(M)
I know it doesn't send an object via pipe. I only wanted to pass it into one line, I have about 600 homefolders and wanted to create a *.bat and run it at the same time.
ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.
One of a set of tools we're offering as a way to say thank you for being a part of the community.
It reads like a problem in your input file rather than the script.
I suggest you Write-Host the values it's trying to use before you use them.
Chris