April 16, 2014 at 10:58 am
Comments posted to this topic are about the item Stairway to SQL PowerShell Level 6: PowerShell Modules
May 4, 2014 at 7:57 pm
In this article you say:
Listing 6.3 Creating a file that will be used with dot-sourcing
Dot-sourcing simply means to use a period and then a space followed by the name of a .ps1 file to load in.
OK... Here's what I'm reading. (a dot, followed by a space, then the name of a file)
. FirstPowerShell.ps1
Is that what you mean? Somehow I don't think I'm understanding this correctly.
May 4, 2014 at 8:11 pm
I simply mean that when you think of a module you will use Import-Module modulename.
With dot-sourcing, it is simply a .ps1 file somewhere that has a function in it or code that you want run without typing it in.
So it is a . PathTo.ps1
dot space FullPath (unless it is in the same directory, then it is a ./file.ps1 for the path)
Does that help?
May 5, 2014 at 10:17 am
Yes... that helps. Thank you for confirming. It just sounded odd to me having a file that is dot, space, [name]ps1
September 9, 2014 at 8:25 pm
Listing 6.1 contains a bug.
if($Username -and $Password)
{ $con = new-object ("Microsoft.SqlServer.Management.Common.ServerConnection") $sqlserver,$username,$password }
else
{ $connection = new-object ("Microsoft.SqlServer.Management.Common.ServerConnection") $sqlserver }
The $con variable is never used and should be changed to $connection.
September 9, 2014 at 8:53 pm
Thanks. I will have that fixed.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy