![]() |
|
|||||||
| Notices |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#21 |
|
Guest
Posts: n/a
|
Re: Scripted Installation with PowerShell
Shay,
I trimmed your transcript down to the essentials: $server = "MOSS1" $sqlroot = "\\$server\c$\mssql\" $sqldata = "\data" $sqllog = "\log" $datapath = Join-Path -path $sqlroot $sqldata $logpath = Join-Path -path $sqlroot $sqllog mkdir $sqlroot mkdir $datapath mkdir $logpath $sqlExec = "C:\Program Files\Microsoft SQL Server\90\Tools\Binn\sqlcmd.exe" & $sqlExec -S $server -i c:\posh\DB_Create_Script.txt ....and it works. Thanks, I don't see what is different, but I appreciate everyones efforts! BTW, This is all on one box. No remote access. The only other possability is that all my variables are stored in a seperate script file that I dot source. Thannks again all. -- Matthew McDermott, MVP Principal Consultant Catapult Systems, Inc. "Shay Levi" wrote: > > Matthew , > > I used v1. Just for the testings, can you run the same commands I executed > and see if any errors arise? > Are you running sqlcmd against a remote server or from a local context? > > > --- > Shay Levi > $cript Fanatic > > > > I am using version 1. Should I be using version 2? > > > > "Marco Shaw [MVP]" wrote: > > > >> Matthew McDermott wrote: > >> > >>> Shay, > >>> > >>> So it worked for you without error? > >>> > >>> Is there some permission that I am missing? I am not clear on how to > >>> proceed... > >>> > >> So version check ya'll... > >> > >> PowerShell's handling of DOS commands was planned to slightly change > >> in v2. > >> > >> I couldn't tell you if anything has been changed as of CTP2 though. > >> > >> Marco > >> > >> -- > >> Microsoft MVP - Windows PowerShell > >> > >> PowerGadgets MVP > >> > >> Blog: > >> > > > |
|
|
|
#22 |
|
Guest
Posts: n/a
|
Re: Scripted Installation with PowerShell
When dot-sourced, your variables become global variables (available to multiple scopes). The varaibles also remain active even after the script ends, so I don't think this can be the cause to the problem. But hey, it works for you now ![]() --- Shay Levi $cript Fanatic MM> Shay, MM> MM> I trimmed your transcript down to the essentials: MM> MM> $server = "MOSS1" MM> $sqlroot = "\\$server\c$\mssql\" MM> $sqldata = "\data" MM> $sqllog = "\log" MM> $datapath = Join-Path -path $sqlroot $sqldata MM> $logpath = Join-Path -path $sqlroot $sqllog MM> mkdir $sqlroot MM> mkdir $datapath MM> mkdir $logpath MM> $sqlExec = "C:\Program Files\Microsoft SQL MM> Server\90\Tools\Binn\sqlcmd.exe" & $sqlExec -S $server -i MM> c:\posh\DB_Create_Script.txt MM> MM> ...and it works. Thanks, I don't see what is different, but I MM> appreciate everyones efforts! MM> MM> BTW, This is all on one box. No remote access. The only other MM> possability is that all my variables are stored in a seperate script MM> file that I dot source. MM> MM> Thannks again all. MM> MM> "Shay Levi" wrote: MM> >> Matthew , >> >> I used v1. Just for the testings, can you run the same commands I >> executed >> and see if any errors arise? >> Are you running sqlcmd against a remote server or from a local >> context? >> --- >> Shay Levi >> $cript Fanatic >> >>> I am using version 1. Should I be using version 2? >>> >>> "Marco Shaw [MVP]" wrote: >>> >>>> Matthew McDermott wrote: >>>> >>>>> Shay, >>>>> >>>>> So it worked for you without error? >>>>> >>>>> Is there some permission that I am missing? I am not clear on how >>>>> to proceed... >>>>> >>>> So version check ya'll... >>>> >>>> PowerShell's handling of DOS commands was planned to slightly >>>> change in v2. >>>> >>>> I couldn't tell you if anything has been changed as of CTP2 though. >>>> >>>> Marco >>>> >>>> -- >>>> Microsoft MVP - Windows PowerShell >>>> >>>> PowerGadgets MVP >>>> >>>> Blog: >>>> |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
< Windows Help - MS Office Help - Hardware Support >
| New To Site? | Need Help? |