Friday, May 3, 2024
HomePowershellJune replace 1 - Visible Studio Code and debugging

June replace 1 – Visible Studio Code and debugging


Beginning with one thing new on my weblog!

I discover that my work is more and more specializing in a smaller matter (PowerShell) and that I’ve much less to weblog about.

I miss running a blog, so I got here up with the month-to-month updates.
In these updates I need to give an perception into my work & share what I did and realized that day, and what struggles I encountered.

I’ve completed it beneath for final week, however in the midst of the week I already seen that I wouldn’t preserve this up like this. So, it went from Weekly- to Month-to-month- updates. The day by day updates as beneath is not going to be within the subsequent replace.

And naturally I can get new inspiration from these posts to weblog about, as a result of I’ll preserve higher observe of what I do per day! Win-win?


What occurred this week?

We work with the Agile methodology in our group. Just a few weeks in the past we acquired a coaching about Agile coaching and there we realized that we should always focus much more on working collectively per PBI, and never that everybody has their very own PBI inside the dash.

This week we began a pilot to focus extra on collaboration. Very enjoyable and academic, though it didn’t run like a well-oiled machine but, we did share extra information with one another this week that we didn’t know the opposite knew.

This week was primarily focuses on Visible Studio Code and debugging (coincidence), how do I take care of debugging and the way does the opposite particular person take care of debugging?

At Wortell we provide prospects the trendy office. It is a mixture of various merchandise, together with Intune, and so on. What in the end issues is that the tip consumer has a tool that he can use wherever he desires.

The workspace is put in utilizing PowerShell. Preserving the settings up to date can be completed by Wortell. To maintain the office updated with the usual, we use Configuration Drift. We evaluate the templates, exceptions, and tenant settings and make adjustments the place mandatory.

We’re presently working arduous to replace the Configuration Drift.


Monday

Monday was a collaboration day the place we wished to standardize the Configuration Drift a bit extra for the trendy office.
What precisely can we need to do, how can we do that, and the way can we proceed with this sooner or later?

What we primarily came upon was that it was not but standardized per part inside the modules, so we now regulate a small half per part to make it equal. To work extra agile, we work through vertical slicing and we work on a small a part of code at a time to have the ability to oversee what we’re adjusting.

And I additionally realized one thing new in debugging on Monday. Do you know that you may put the breakpoint in a brand new place and that this already works DURING the debugging? So suppose you need to press F11 too typically to get the place you need, you may also simply set the breakpoint once more.


Tuesday

On Tuesday I continued to carry the Configuration Drift to a regular. I primarily targeted on a part of the code that I created.

As well as, right this moment I bumped into one other bug in one in all my cmdlets. With Get-StorageBlob I retrieve the recordsdata from an Azure Storage Blob. Typically the BOM characters are handed within the bytes so I can’t convert it to json format anymore.

My information is nil on this space, and after infinite Googling I solved it with a pastime answer with a regex, a hardcoded, and an additional exchange simply to make certain.

if ($Return.GetType().Identify -eq 'String') {
    $Return = $Return -Change 'xEFxBBxBF', '' 
    $Return = ($Return).exchange('', '').Change('ÿþ', '')
    $Return = ($Return).exchange('xEFxBBxBF', '')
}

it seems like sh*t within the code itself, however hey, it really works. Fortunately I’ve a colleague who can have a look subsequent week & resolve this.


Wednesday

On Wednesday we had the product day. On today, completely different developer groups come collectively and we take a look at new options and share information with one another.

And we ended the day with a beer and a barbecue.

And sh*t, I came upon that Tuesday’s repair solely works in PowerShell model 7 and above. So, now I’ve to search out out if we actually aren’t utilizing a decrease model someplace.


Thursday

I managed to steer my colleagues to start out utilizing my Optimized.Mga module by displaying what the Batch-Mga cmdlet can do.

We are going to use this as a pilot in a part of Configuration Drift.

Today was the day that I had the best shock of the week.

My colleagues don’t like this, however I’m working with the git GUI in Visible studio code and as a substitute of urgent the stage all adjustments button, I pressed the discard all adjustments button.

Visible Studio Code and debugging

Which implies all of your present adjustments shall be reverted. Huge shock this morning, however a number of search phrases later I came upon that Visible Studio Code maintains an area file historical past administration and fortunately I used to be capable of replace the recordsdata again to probably the most present standing.

You are able to do this with Ctrl + Shift + P and sort in Native Historical past, this can present you the choices you have got for the Native Historical past.

Visible Studio Code and debugging

Friday

Right now I used to be lastly capable of proceed with Configuration Drift.
Numerous debugging in VSC.

Do you know that you may additionally edit breakpoints that they solely set off on an expression in Visible Studio Code?
Tremendous helpful for while you solely need to begin testing at a sure worth with out having to regulate your code your self (taught a colleague).

Proper click on the Breakpoint and click on on Edit Breakpoint.

Visible Studio Code and debugging

Now add the expression you’d just like the debugger to cease on. This generally is a depend, a variable, or no matter.

Visible Studio Code and debugging

Abstract of what I realized this week

I’ve new objects for weblog posts! See the factors beneath, you’ll be able to anticipate these within the close to future!

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments