Solved

Missing expression after ','

Posted on 2012-04-02
1
1,531 Views
Last Modified: 2012-04-02
Hello

When I execute :
param
(
      [string]$A = "",
      [string]$I = "",
      [string]$S = "",
        [string]$g = "",
        [string]$T = "",
        [string]$f = "",
        [string]$u = "",
        [string]$up = "",
        [string]$c = "",
        [string]$cp = "",
        [string]$v = "",
        [string]$ip = "",
        [string]$r = "",
      [switch]$Help ,
      [switch]$Serbose,
      [switch]$debug
)

$net = new-object -ComObject WScript.Network
$net.MapNetworkDrive("z:", "\\server", $false,`"$u`", `"$up`")

The following error is returned :
Missing expression after ','.
At C:\install_bin_1-0.ps1:45 char:75
+ $net.MapNetworkDrive("z:", "\\server", $false, <<<< `"$u`", `"$up`")
    + CategoryInfo          : ParserError: (,:String) [], ParseException
    + FullyQualifiedErrorId : MissingExpressionAfterToken

Thanks

bibi
0
Comment
Question by:bibi92
1 Comment
 
LVL 1

Accepted Solution

by:
Xizz earned 500 total points
Comment Utility
You are doing strange things for me here:

$net.MapNetworkDrive("z:", "\\server", $false,`"$u`", `"$up`")

I think it must be something like:

$net.MapNetworkDrive("z:", "\\server", $false,"$u", "$up")
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Utilizing an array to gracefully append to a list of EmailAddresses
In this previous article (https://oddytee.wordpress.com/2016/05/05/provision-new-office-365-user-and-mailbox-from-exchange-hybrid-via-powershell/), we made basic license assignments to users in O365. When I say basic, the method is the simplest way …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now