Trouble with spaces in the args

Welcome Forums General PowerShell Q&A Trouble with spaces in the args

This topic contains 0 replies, has 1 voice, and was last updated by  Forums Archives 7 years, 2 months ago.

  • Author
  • #6030

    Points: 0
    Rank: Member

    by sqlpadawan at 2013-02-21 11:09:42

    I'm having trouble with spaces in the args.

    # sql server 2008 path
    $DTSPath = (Get-ItemProperty -path "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\100\SSIS\Setup\DTSPath").'(default)'

    #C:\Program Files\Microsoft SQL Server\100\DTS\Binn\
    $BinnPath = = $DTSPath + "BINN\"

    #C:\Program Files\Microsoft SQL Server\100\DTS\Packages\
    $PackagePath = $DTSPath + "Packages\"

    $BinnPath = $DTSPath + "BINN\"
    $PackagePath = $DTSPath + "Packages\"

    $cmd = $BinnPath + "dtutil.exe"
    $arg1 = "-file C:\Users\bullenkr\Documents\Visual Studio 2008\Projects\TestDeployment\TestDeployment\bin\Deployment\TestDeployment.dtsx"
    $arg2 = "-copy FILE`;$PackagePath\TestDeployment.dtsx'";

    & $cmd $arg1 $arg2;

    Write-Host $LastExitCode;

    When I run it, it pops an error on $arg1;

    Option "Studio" is not valid.

    I know this should be easy, but I can't seem to get it today.

    Any ideas?

    by ArtB0514 at 2013-02-21 12:49:39

    See if this way (an extra set of quote marks) works:
    $arg1 = '-file "C:\Users\bullenkr\Documents\Visual Studio 2008\Projects\TestDeployment\TestDeployment\bin\Deployment\TestDeployment.dtsx"'

The topic ‘Trouble with spaces in the args’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort