Stairway to SQL PowerShell Level 1: SQL PowerShell Basics

  • fmonsua (7/21/2015)


    $wintitle = $CurrentUser.Name + " " + $Host.Name + " " + $Host.Version

    Or

    $wintitle = "$($CurrentUser.Name) $($Host.Name) $($Host.Version)"



    Ben Miller
    Microsoft Certified Master: SQL Server, SQL MVP
    @DBAduck - http://dbaduck.com

  • Thanks a lot for this! I've been looking for the most basic introduction to Powershell so that I can see how it will work for me with SQL Server. It's been tough to wade through what information is available in blogs and videos.

    This first article in the series gave me just what I needed to simply get my feet wet and explore just a little bit of PS. My only trip up came when I wasn't completely understanding where the profile file needed to be saved. I figured it out after re-reading the instructions a couple of times.

  • That's great. Glad you found it useful.



    Ben Miller
    Microsoft Certified Master: SQL Server, SQL MVP
    @DBAduck - http://dbaduck.com

  • dbaduck - Thursday, February 9, 2017 8:07 AM

    That's great. Glad you found it useful.

    I found it helpful too...Thank you!

  • Anyone else going through this stairway in 2020?  I am!!!

  • Hi Ben

    Listing 1.1

    $wintitle = $CurrentUser.Name + " " + $Host.Name + " " + $Host.Name

    Is this line of code correct ?

     

    Thanks

    Steve

     

  • No as illustrated above, instead of $Host.Name on the second one, it was supposed to be $Host.Version.

    Good catch.



    Ben Miller
    Microsoft Certified Master: SQL Server, SQL MVP
    @DBAduck - http://dbaduck.com

Viewing 7 posts - 31 through 37 (of 37 total)

You must be logged in to reply to this topic. Login to reply