FLPSUG – Next Online meeting July 26th 2017

I’m working on getting a meeting with Keiser University to allow me to host my Florida PowerShell User Group Monthly meetings at their Port St. Lucie Campus location.  But, in the meantime, I setup July’s Online meeting for Wednesday 26th at 6:30pm (EST).

This month topic:

Working with SQL Server for Linux Cross-Platform

You’re welcome to explore the latest build of SQL Server for Linux, including everything you need to install and connect to SQL Server. He will also look into the tools that are available to use from Linux and / or Windows. Maximo will provide samples on querying for database information using Python/Java and PowerShell between two environments. This will be a demo intensive session you will not want to miss!

To register, click on the following Eventbrite link: https://www.eventbrite.com/e/florida-powershell-user-group-monthly-meeting-july-2017-tickets-36113308879?ref=estw

I hope you can joined me in this exciting session!

South Florida SQLSaturday – Working with SQL Server in Linux session

First! Thanks to the organizers, and specially the attendees as they waited patiently to the attend my last session of the day “Working with SQL Server for Linux Cross-Platform”. It proves to be good. Love their interaction and the will to embrace technology.

As, I almost didn’t make it to the event, due to car problem, I one my coworker gave me ride to the event at Nova Southeastern University. I missed giving the early session “SQL Server working with PowerShell and Python” so I ended up merging both sessions into one.

For my surprise, the last session went better than I expected. I ran everything from Azure Cloud which work like a charm, and the attendee were awesome.

Both presentation and all demo scripts were uploaded to the SQLSaturday #627 event site. I hope you all take advantage of the resource link I provided.

In the demo it’s interesting we covered the following on PowerShell Core, Python 3.6 (Anaconda), and SQL Server 2017 (Linux):

* In Window 10, using SSMS v17.1 connecting to SQL Server 2017 in Linux
* In Linux, connect to a Windows Shared folders
* In Windows, using SSMS to restore a Windows Database into Linux SQL Server.
* Sample script using Python tk (Gui) w/pyodbc (SQL connector), and PowerShell displaying PowerShell object in a Gridview.
* Using SMO in Linux with PowerShell.

And, we did covered a lot in a short time.

By the way, I will be giving the same session at IDERA’s Geek Synch webinar, on July 12th, at 11:00am CT/12:00pm ET:

Geek Sync – I Working with SQL Server for Linux Cross-Platform
https://register.gotowebinar.com/register/9138484624537412611

Once again Thanks to everyone!

I’ll see you all in Orlando SQLSaturday #678 on October 7th!

Issues with VS Code “PowerShell Integrated” feature

As VS Code continues to evolve, we need to keep in mind that technology keep changing fast. Some of us on Windows Insider Fast Ring get the opportunity to test drive the latest build of Windows 10.

But there are times when these upgrades with break something in one of our installed applications. Just don’t despair, as there’s always a workaround!

In the last Windows Insider Build 16193, did break in VS Code (and the VS Code Insider) editor as their new feature “PowerShell Integrated” won’t work. Microsoft knows about it an it will be fix down the line. This issue will impact both Windows PowerShell, and PowerShell Core.

This issue is only on Windows 10 Build 16193 including WSL (Windows 10 Bash), and will be corrected soon.  In Windows 10 Bash console, PowerShell Core will get hung!

But, don’t worry! If you installed Ubuntu Desktop in Windows 10 Bash, then you can use PowerShell without any issues.

VS Code Workaround for “PowerShell Integrated”

If you want some information about this issue, feel free to checkout the following *link:
https://github.com/PowerShell/vscode-powershell/issues/742#issuecomment-301915916

*Note: Thanks to David Wilson (https://github.com/daviwil) for providing the workaround for VS Code.

In the link above, you’ll find the workaround to fix the issue. Basically, is creating the profile for VS Code (“Microsoft.VSCode_profile.ps1“) and adding the following line:

File: Microsoft.VSCode_profile.ps1
[System.Console]::OutputEncoding = [System.Text.Encoding]::ASCII
Write-Host “PowerShell version X.x.x loaded”

Where are these VS Code profile files been stored at in Windows?

Keep in mind. These profile files you need to create them at the following locations:

1. For Windows PowerShell – C:\Users\mtrinidad\Documents\WindowsPowerShell

2. For PowerShell Core – C:\Users\mtrinidad\Documents\PowerShell

3. In Linux, for standard profile.ps1 file – /opt/microsoft/powershell/6.0.0-beta.1 

In order for the profile to be use in VS Code, we need to add the following line in the “setting.json” file: “powershell.enableProfileLoading”: true

What other PowerShell tools you can use in VS Code?

Use “Code Runner” extension.  Then, from the menu look for “Preferences | Settings” which will open the “settings.json” you can configure which PowerShell version you want to use with the following lines:

1. For Windows PowerShell use:
“powershell”: “powershell.exe -ExecutionPolicy ByPass -File”,

2. For PowerShell Core:
“powershell”: “\”C:\\Program Files\\PowerShell\\6.0.0-beta.1\\powershell.exe\” -ExecutionPolicy ByPass -File”,

To execute a PowerShell script using Code Runner extension, just right-click and select “Run Code“. Then, all PowerShell results will be display under the “Output” section.

Changing “PowerShell Integrated” Terminal behavior

The normal behaviour when using the “PowerShell Integrated” is that you can highlight a few lines or execute the whole script and the results will be display in the “Terminal” section.

So, Yes! You can change the Terminal Integrated behavior to run other type of console: Bash, DOS, and even PowerShell version X as a standalone host. Just look at under the Settings Preferences “Settings.json” file by copy/paste the following line:

  • For Dos – “terminal.integrated.shell.windows”: “cmd.exe”,
  • For PowerShell Core – “terminal.integrated.shell.windows”: “C:\\Program Files\\PowerShell\\6.0.0-beta.1\\powershell.exe”,
  • For Windows PowerShell – “terminal.integrated.shell.windows”: “powershell.exe”,
  • For Linux Bash – “terminal.integrated.shell.linux”: “bash”,
  • For Linux powershell – “terminal.integrated.shell.linux”: “powershell”,

Sample image “Settings.json”:

Go ahead! Give it a try and experiment.

Check Out Github

If you’re interested in contributing, providing feedback and helping with the development of PowerShell Core, don’t forget to check out Github: https://github.com/PowerShell/PowerShell

Always remember!
* For issues, bugs, and feedbacks with Windows PowerShell, use the following link at “Windows PowerShell UserVoice“: https://windowsserver.uservoice.com/forums/301869-powershell/category/148044-powershell-engine

* For issues, bugs, and feedbacks with PowerShell Core, use Github: https://github.com/PowerShell/PowerShell/issues