I’m automating some tasks and ran into an issue that I haven’t been able figure out. Basically I’m trying to run database queries that use keys in Powershell. Example:
.\SQLite.exe -key $key $database < $commandsTXT
However I’m forced to use this expression because Powershell doesn’t like spaces and the < character.
.\SQLite.exe -key `"$key`" `"$database`" `"<`" `"$commandsTXT`"
I have two questions. 1) Can I make this less ugly? 2) Why am I getting the error, “Too many options”.
Thanks!
How about this?
This will pipe the contents of
$commandsTXTinto SQLite. I’m assuming$keyand$databaseare strings.