Solved

Missing expression after ','

Posted on 2012-04-02
1
1,629 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
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Powershell Active Directory Attribute LVR Metadata 3 19
DFS issue 3 26
Copy Function with attributes 1 24
Exchange 2013 - Scheduled task to clear IIS logs 2 12
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 …
Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

829 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