Getting Azure Automation runbooks to shut down your virtual machines (or turn them on) automatically is not new. There are a lot of scripts out there that could do it for you. You can also write one yourself. It's not that complicated. I did it J Just kidding…
There are a couple of ways my PowerShell scripts are different:
- First, the scripts that automatically start/stop Azure virtual machines take the weekend into account. Scripts will not turn your machines on or off on the weekends. After all, you probably do not want to automatically turn on your virtual machines in Azure early in the morning on the weekend, just so that you can turn them off at the end of the day on the weekend. Seems like a waste, right? Anyways, this small change should save you a few bucks.
- Second, the scripts adjust the schedule from UTC to the time zone you need. It looks like when the scripts that are part of Azure Automation runbooks run, they use UTC time. So, if you're in Toronto, script will think that the weekend starts 5 hours earlier. It's not bad, I guess. But, it also means that the weekend will end 5 hours earlier, and that just not right and need to be fixed.
Below is a code snippet that makes the above mentioned happen:
$UTCTime = (Get-Date).ToUniversalTime()
$TZ = [System.TimeZoneInfo]::FindSystemTimeZoneById("Eastern Standard Time")
$LocalTime = [System.TimeZoneInfo]::ConvertTimeFromUtc($UTCTime, $TZ)
$day = $LocalTime.DayOfWeek
if ($day -eq 'Saturday' -or $day -eq 'Sunday')
Write-Output ("It is " + $day + ". Cannot use a runbook to start VMs on a weekend.")
The complete scripts that start or stop Azure virtual machines can be downloaded from OneDrive. Enjoy.
So, you have installed Git client and trying to connect to Git server (on Visual Studio Team Services, Github, or whatever), but you're getting "fatal: unable to connect a socket (Invalid argument)" error. One of the reasons could is that you're behind the proxy. For example, you're at work and your employer requires all internet traffic to go through the proxy. ~/.gitconfig global config file is the key here. In this case, to get Git client to work with the proxy, you need to configure http.proxy key in git config using one of the following commands:
git config --global http.proxy http://proxyuser:firstname.lastname@example.org:8080
git config --global https.proxy https://proxyuser:email@example.com:8080
- change proxyuser to your proxy user
- change proxypwd to your proxy password
- change proxy.server.com to the URL of your proxy server.
- change 8080 to the proxy port configured on your proxy server
If you do not need to authenticate to proxy, then just specify proxy server name and port number and skip proxy user and password.
If you decide at any time to reset this proxy and work without (no proxy), use one of the the following commands:
git config --global --unset http.proxy
git config --global --unset https.proxy
Finally, to check the currently set proxy, use one of the following commands:
git config --global --get http.proxy
git config --global --get https.proxy
By the way, to retrieve the proxy settings you're using, you can use one of the following commands:
reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" | find /i "proxyserver"
netsh winhttp show proxy
That's all I got to say about Git and proxy server.
I was recently having trouble generating some Release Notes for a current project that is using
Visual Studio Online Visual Studio Team Services. With Git as our backing source control system there didn’t seem to be an easy way to see what Work Items were going into a release. Thankfully we are associating Work Items with commits which makes the following Powershell script work.
Passing in our current release branch, and our previous release branch we can isolate the new commits and then parse their commit messages looking for the “Related Work Items:” text that Visual Studio appends to commits. Once we have those WorkItem ids we can use the TFS api to get some info about them and create some release notes.
You can find the script on GitHub.
MVPDays is a series of one day events that focuses on content for IT and Dev Professionals sharing their knowledge allowing local communities to learn more and advance their skills based on real world experiences. The majority of the sessions are Content will focus on the following topics:
- IT PRO
- SharePoint / Office 365
It will be held in the following cities:
I recently had an interesting experiencing writing post build PowerShell script for a client. The client wanted to check in certain files into source control after the build is finished. Sounds easy, right? You can use either good old tf.exe command line utility from Visual Studio command tools. Or, you can use something more current like PowerShell to write a simple script that will check in pending changes for you. The problem is that the client also wanted to associate work items with the check in. Not a big deal, right? Well, apparently it is a big deal. You cannot associate work item with the check in using tf.exe command tool. And, what's even stranger, I could not find a way to associate work item with the check in using PowerShell. I got stuck with figuring out how to make WorkItemCheckinInfo parameter in Workspace.Checkin method to work properly.
This is how I learned that apparently you can associate work item with TFS check in, but you have to use tf.exe command from Team Explorer Everywhere. Apparently, even though the names are the same, those are very different command line utilities. When you use tf.exe from Team Explorer Everywhere, you can associate work item with the check in using a simple command:
tf checkin ItemSpec -associate:WorkItemIds
It's that easy. I just wish –associate option was available in common tf.exe command from Visual Studio command tools. I would also wish that those two seemingly identical tf.exe commands would actually do the same thing (the same way), or at least that those commands would have different names to avoid the confusion. By the way, there are also other differences between those two commands with the same names. You can get them form the links provided in the post. I'm too upset to list myself L
Here is a bunch of links to resources that will help you get up to speed on what's new for developing Windows 10 applications.
Want to download Visual Studio SKU's including VS 2015 click here
Everything you needed to know to write applications using MS Tools
Windows 10 and what's new
Want to take Microsoft Virtual Academy (MVA) Windows 10 Courses click here
Channel 9 has some great windows 10 related videos here
I have started a new user group with the focus on Enterprise DevOps. DevOps is getting significant attention in the industry. Many organizations don't understand what DevOps is, how to adopt DevOps practices effectively within the organization, and are not aware of what DevOps tools to use. Toronto Enterprise DevOps User Group is focused on applying DevOps practices in the enterprise environment. This group is for people in the Greater Toronto Area who are interested in continuous deployment/integration, release management, infrastructure as code, change/configuration management, load testing & auto-scale, performance/availability monitoring, capacity management, automated testing, automated environment provisioning/de-provisioning, self service environments, automated recovery (rollback & roll-Forward), and many more of constantly evolving DevOps practices. Every level of experience is welcome, all we ask is that you come with an open mind and are excited to share your knowledge.
The first meeting is on September 10th, 2015. We'll start with a discussion of What is DevOps? DevOps is a term for a group of concepts that, while not all new, has catalyzed into a movement and is rapidly spreading throughout the technical community. Like any new and popular term, people have somewhat confused and sometimes contradictory impressions of what it is. Is it "Quality" or "Agile,"? Well, DevOps is a large enough concept that it requires some nuance to fully understand. DevOps is the practice of operations and development engineers participating together in the entire service lifecycle, from design through to the development process to production support. We will cover what DevOps is and is not during our first user group meeting.
Visit our website for more info. See you there.
Next week I will be going back to school. Well sort of.
I am going to teach a one day seminar on programming to students grades 6-12 at Synergy.
Synergy is a
summer experience program
offered by the DeGroote School of Business
at McMaster University for students in grades 5 -12. It affords students the opportunity to experience business as a field of study in a post-secondary setting.
I'm teaching the class using Python and Visual Studio.
Should be a lot of fun.