Archive for the 'Uncategorized' Category Community & Newsletter Launched

As many of you probably know by now, last month I joined 42 Crunch as VP of Cloud Platform. As one of my first pet projects in the company, today we are launching – so I wanted to take a few minutes to explain our thinking and goals for the project.

API economy is on the rise:

  • Twilio just announced that it is acquiring SendGrid for $2 billion,
  • Even non-tech companies are becoming more and more API-oriented: Expedia attributes more than 80% of its revenue to APIs,
  • IoT is on the rise with smart-everything devices getting into our homes (there is an Alexa-enabled microwave from Amazon now!), workplaces, and cities.

All of this makes API security critical. In fact, Gartner expects that by 2022, APIs will become the most common attack vector out there.

42 Crunch provides end-to-end API security solutions from OpenAPI/Swagger file assessment, to live API scanning, to API firewalls, and has been named Cool Vendor of the Year by Gartner. is going to be our community hub for all things API Security. We have just launched it and it hosts a weekly newsletter with the major news from API Security delivered to your mailbox once a week.

See you there!


Fixing “Debug adapter process has terminated unexpectedly” error in VSCode for PowerShell

VSCode is the primary tool that Microsoft provides on Linux and Mac OS to edit and debug PowerShell scripts. Yet, on MacOS, with default installation, you are likely to get the “Debug adapter process has terminated unexpectedly” when you try running your scripts.

However, to fix this issue you simply need to install OpenSSL on your Mac running VSCode as described here.

Once this is done, simply:

  1. Click File / Open and open the folder containing the PowerShell script,
  2. Click the script that you want to edit in the left-hand pane,
  3. Set breakpoints where you want them by clicking on the margin by the corresponding script line,
  4. Press F5 or click the run button in the editor:

Debugging PowerShell scripts on Mac OS X in VSCode

Happy scripting!

Enabling Intellisense for PowerShell cmdlets in VSCode on Mac OS X

VSCode is the primary way to edit and debug PowerShell scripts on Mac OS and Linux. If you do not have it yet, follow these instructions on GitHub on installing VSCode on Mac OS/Linux/Windows and adding its PowerShell extension.

Once you are done with that, you can create a new or open an existing PS1 file, however, you might still get “No suggestions” error when you try to get intellisense for cmdlets:

VSCode on Mac no suggestions

This is because this functionality actually requires OpenSSL. Here’s how you add it to your system:

Install Homebrew

Homebrew is Mac’s most popular package manager. To install it:

  1. Open a Terminal window,
  2. Install Mac OS command-line developer tools (xcode) by pasting the following command and pressing Enter:
    xcode-select --install

    Install Mac OS command-line developer tools xcode
  3. Install Homebrew package manager by pasting the following command:
    ruby -e "$(curl -fsSL"
    Installing Homebrew Mac OS package manager
  4. Double-check that the installation is successful by running

    brew doctor

    System ready to brew

Install OpenSSL

Now install OpenSSL on Mac OS by simply pasting the following command to the Terminal window:

brew install openssl

 Install openssl on Mac OS X with homebrew

Verify PowerShell cmdlet intellisense in VSCode

  1. Start VSCode,
  2. Open a ps1 file or save the file that you have as .ps1,
  3. Verify that PowerShell is selected as the language mode at the bottom right of the VSCode window:PowerShell language mode in VSCode
  4. Type Get- and you will see the intellisense window popping up with the list of available Get- cmdlets:VSCode with intellisense for PowerShell cmdlets

Run PowerShell on Mac OS X

As you have probably heard by now, Microsoft has just open-sourced PowerShell and made it available for Linux and Mac OS X. In this blog post, I will take you through the steps to download, install and run PowerShell on a Mac.

Download and Install PowerShell for Mac OX

  1. Go to PowerShell github project:
  2. Scroll down to the Get PowerShell section and download .pkg:

Download OS X pkg file for PowerShell

3. Locate the newly downloaded file in Downloads, right-click it and click Open:

Install PowerShell pkg on Mac OS X

4. You will be warned that this is a file from the Internet and then prompted for your local administrative password, then go through the installation wizard.

Run PowerShell on Mac OS X

PowerShell is a command-prompt in your terminal window, so to start it:

  1. Start the Terminal application,
  2. Now you can simply type powershell as a command and this will start the PowerShell engine and move you from the bash prompt ($) to the PowerShell prompt (PS):
    Starting PowerShell prompt on Mac OS X in bash Terminal

  3. That is it! You can now type a PowerShell command and see the output. For example, here’s Get-Process:
    Get-Process powershell command on Mac OS X

If you are new to PowerShell, see the Learning PowerShell page on GitHub.

Upvote PowerShell in WindowsITPro Community Awards

WindowsITPro is doing their annual Community Choice Awards voting – and there’s a bunch of PowerShell-related nominees:

1. SDM & SpecOps in Group Policy – both have PowerShell,
17. Best Wireless/Mobile: SAPIEN iPowerShell
20. Scripting Tools: PowerGUI, PowerShell Plus, PowerShell, Sapien PowerShell Studio,
25. Task Automation: Microsoft Windows PowerShell,
26. Training and Certification: Sapien PowerShell videos,
28. Free and Open-Source: PowerShell Plus, PrimalForms.

The voting closes tomorrow – Sept 20, 2013 – so there’s still a chance to upvote the PowerShell tools that you like. 🙂

PowerShell Script to Bulk-Change Excel File Formats

Today I had to find a way to change file formats for a lot of files. Here at Jelastic we use JIRA for bug-report tracking. Every week I am getting tons of automated reports from JIRA to send around to our partners and so on. The problem is that JIRA exports reports in some weird html format with xls extention, and although Windows Excel can open it (after displaying ‘the file format and extension do not match’ warnings) – Macs cannot.

Opening and resaving lots of files manually was not an option – PowerShell was. 🙂

[UPDATE] I’ve made a few minor changes per feedback from Stanley – now properly managing file extansions and formats.

Here’s the script that you can reuse if you have a similar problem to solve:

# PowerShell script to open all Excel files in a folder
# and re-save them in proper format
# (c) Dmitry Sotnikov

# create COM object to use Excel
$objExcel = new-object -comobject excel.application

$objExcel.Visible = $True

# open the files to re-save one by one
dir D:\myfolder\*.xls | ForEach-Object {
$doc = $objExcel.WorkBooks.Open($_.FullName)

# Save in new format and with new extension
# Format codes can be found here:

$objExcel = $null

Parsing LinkedIn html pages with PowerShell

A couple of weeks ago we posted a job opening on LinkedIn (were looking for a person to be in charge of our Jelastic‘s professional services), and it turned out that while LinkedIn jobs attract a lot of applications, the site itself does not make it easy to process them afterwards. You get CVs in email, and they also post a list of applicants with email addresses, phone numbers, titles, etc. – but there is no way to export the list to, say, Excel. In our case, we really wanted to have the data exported, so we could jointly work on a shared spreadsheet and everyone involved could grade each applicant and add notes to the table.

Being a PowerShell guy, I wrote the script below that does the scraping for me. 🙂 Basically, I just saved the page with the list of applicants to my local disk and found that in their html, each applicant information is contained in vcard element, which has class name with LinkedIn URL and the actual name, and then elements with email and phone number:

So all my script has to do is: create an IE object and then use it to find the corresponding fields, then create custom objects from them, add them to the collection, and export it to CSV. Here’s the code – hope it helps you solve similar tasks when other sites do not provide good export capabilities:

$ie = new-object -com "InternetExplorer.Application"

# The easiest way to accomodate for slowness of IE
Start-Sleep -Seconds 1


# The easiest way to accomodate for slowness of IE
Start-Sleep -Seconds 1

$doc = $ie.Document

# Get a collection of vcard elements
$cards = $doc.body.getElementsByClassName("vcard")

# This will be our collection of parsed objects
$processesCards = @()

# Iterate through the collection
for ($i=0; $i -lt $cards.length; $i++) {

 $itm = $cards.item($i)

 # Get the 'name' element that has the applicant name and URL
 $name = $itm.getElementsByClassName("name").item(0).

 # If you want you can output the name to the screen 
 # so you know where you are

 # Get the phone number and email address
 $phone = $itm.getElementsByClassName("phone").item(0)
 $email = `

 # Below is PowerShell v3 notation. 
 # In v2, replace '[pscustomobject]' with 
 # 'new-object psobject -Property' 
 $obj = [pscustomobject] @{"name"=$name.outerText; 
                           "phone"= $phone.outerText }

 $processesCards += $obj


# Export to CSV - which you can open in Excel
$processesCards | Export-Csv D:\Temp\linkedin.csv 

New in PowerGUI 2.1 – Custom welcome pages

Another great new feature for PowerPack creators is the ability to define a custom HTML or MHT page to be displayed for any node or folder in the PowerGUI Admin Console.

This feature can be incredibly powerful. Not only it lets you establish your own PowerPack branding and with your logos, links to additional resources and so on. It also lets you display your help and other relevant information right inside PowerGUI – you can even add links invoking nodes and actions right from that page!

Check out this quick video which Darin put together:

This feature is part of our PowerPack functionality which allows you to easily create and share administrative UIs on top of PowerShell. Download PowerGUI 2.1, give it a try and let us know what you think!

Subversion (SVN) Source-Control for PowerShell Scripts

I’ve already blogged about the use of PowerGUI Pro Script Editor with Team Foundation Server (TFS), now it’s time to check out integration with another popular source control solution – Subversion.

As with any other revision control system, to integrate PowerGUI needs you to install an MSSCCI provider for the system (this is the API which Microsoft Visual Studio is using). For Subversion there is a bunch of clients available – so use whichever you like as long as MSSCCI is one of its features.

For this post I used TamTam SVN SCC. It seems to be a great client however you would need to pay the author $14.99 unless you enjoy seeing their “Buy now” prompts every few minutes. 😉

(If you really want to save the $14.99 there is also a free SCC client for Subversion: TortoiseSVN – however, you would have to spend a few minutes to make it work because the SCC provider is only supported by a fairly old version of the client – 1.3.5. If you want to go that route, download version 1.3.5 of the client here, and install it along with the TortoiseSVNSCC provider found in Documents & Files section here. You might also have to apply some registry keys on Vista and later.)

Anyway, I went the easy way:

1. Downloaded and installed Subversion v1.4.3 and TamTam SVN SCC .

2. In PowerGUI Pro Script Editor, went to Tools / Options / Version Control, selected TamTam as the Current provider and browsed to the svn.exe file.

3. Now I can add files to Subversion, check out, check in, and so on by using the Version Control menu in the editor:

Don running a survey

Don Jones – one of the most well-known PowerShell trainers, speakers, evangelists and community members is running a survey on his ConcentratedTech site. They have a bunch of $100-$500 certificates to give away, but more importantly this should help them optimize their site for better user experience.

So if you have a few minutes, here’s the survey link.

My Recent Tweets


The posts on this blog are provided “as is” with no warranties and confer no rights. The opinions expressed on this site are mine and mine alone, and do not necessarily represent those of my employer - WSO2 or anyone else for that matter. All trademarks acknowledged.

© 2007-2014 Dmitry Sotnikov

December 2022

%d bloggers like this: