Solved

Missing expression after ','

Posted on 2012-04-02
1
1,735 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
[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
1 Comment
 
LVL 1

Accepted Solution

by:
Xizz earned 500 total points
ID: 37795427
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

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

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

A procedure for exporting installed hotfix details of remote computers using powershell
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…

691 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