Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File Shares Script Fails #9

Open
bdawson9 opened this issue Sep 14, 2018 · 5 comments
Open

File Shares Script Fails #9

bdawson9 opened this issue Sep 14, 2018 · 5 comments
Assignees

Comments

@bdawson9
Copy link

I get the following error message when running the File Shares powershell script:

Exception calling "Matches" with "2" argument(s): "Value cannot be null.
Parameter name: input"
At C:\scripts\file shares\FileShares.ps1:176 char:5

  • $server= ([regex]::matches($Files, "(?<=[\\][\\])[^\\]+"))
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : ArgumentNullException
@CalebAlbers CalebAlbers self-assigned this Sep 27, 2018
@CalebAlbers
Copy link
Collaborator

(troubleshooting via email)

@jasconv
Copy link

jasconv commented Sep 30, 2018

Hi Caleb,

I am also receive the exact same error as bdawson9 reported. Please let me know if you have found a solution or if you need me to help with troubleshooting.

Thanks!

Jason

@theonlytruebigmac
Copy link

Was there any update on this?

@elanasparkle
Copy link

I have the same issue did anyone have anything that could help.

@elanasparkle
Copy link

I found out the issue When there ins't any shares on that machine the $files variable is blank therefore the Regex can't compare anything because if you take the -filter out the script works great.

$Files = gwmi -Class win32_share -ComputerName $computer | Where-Object{$_.Name -NotMatch "^print|^NETLOGON|^MTATempStore|^prnproc"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants