How do I reference a path with a space in it?

Discussion of open issues, suggestions and bugs regarding database management and development tools for SQL Server
Post Reply
mango333
Posts: 40
Joined: Thu 14 May 2015 19:23

How do I reference a path with a space in it?

Post by mango333 » Mon 22 Feb 2016 21:10

I'm using Schema Compare PRO 4.032 on the command line in powershell

Here is my command:
.\schemacompare /snapshot /compress:True /connection:server=MyServer /database:MyDB /file:'I:\Snapshots\My Snapshots\MyDB_snapshot.snap'

The console doesn't display an error but the snapshot doesn't create. If I remove the space in the path and the command, it works as expected. I need to account for the space character - how do I do this in the command?

alexa

Re: How do I reference a path with a space in it?

Post by alexa » Tue 23 Feb 2016 09:30

Please try enclosing the path that contains spaces in double quotes.

mango333
Posts: 40
Joined: Thu 14 May 2015 19:23

Re: How do I reference a path with a space in it?

Post by mango333 » Tue 23 Feb 2016 13:53

I tried that also. It looks like schemacompare.com is run differently in PowerShell vs Cmd Prompt.

Command run in PoSh
.\schemacompare /snapshot /compress:True /connection:server=MyServer /database:MyDB /file:"I:\Snapshots\My Snapshots\MyDB_snapshot.snap"

PoSh Output
Devart dbForge Schema Compare for SQL Server version 4.0.32.0
Copyright 2008 - 2016 Devart. All rights reserved.

=== Snapshot creation started ===

.\schemacompare /snapshot /compress:True /connection:server=MyServer /database:MyDB "/file:I:\Snapshots\My Snapshots\MyDB_snapshot.snap"

=== Snapshot creation finished ===

Notice how the double quote shifted? In the command prompt this does not occur and the command works as it should. I'm guessing this is a PowerShell issue, I'm just not sure how to fix it.

alexa

Re: How do I reference a path with a space in it?

Post by alexa » Tue 23 Feb 2016 15:18

Unfortunately, dbForge doesn't support PowerShell.

Post Reply