Gist extension for VS Code

Gist is a big part of my workflow. I’ve always been on the lookout for a desktop tool. Well, it turns out I was looking in the wrong place. A few days I discovered two VS Code extensions Gist and GitHub Gist Explorer. They both really great extensions and so far I’m really enjoying having Gist at my fingertips in VS Code.

vscode-gist-profiles
Gist
Screenshot
GitHub Gist Explorer

Once you have installed the extension you will need to grab yourself an access token for GitHub – you can get a personal access token by going to settings and then accessing Developer Settings. Make sure you just give the token access to Gists.

GitHub Gist Explorer seems to be my favourite so far. Having the explorer available in the side pain really helps and the command bar paste and save from clipboard features are really great!

How do I use Gist

The majority of my use if private where I have created secret Gists. I have a number of markdown Gists which I have named Gistsmarks which I use as bookmarks to jump to a collection of Gists like boilerplates for my blog articles.

Any code I share on my blog is shared as a Gist. This allows me to embed the code in the article with a nice editor and provides me with version control too. When I started using Gists I painstakingly went through all my posts and converted any previous code blocks into Gists. Oh, and when I reference code I use the highlighted line(s) URL which is a cool trick too.

Highlighting code in a Gist with the URL

I also use Gist to share code and snippets with friends and customers (when it is appropriate of course). I also have runbook like Gists to quickly reference which provide basic lines of PowerShell to perform tasks and run common commands against Microsoft Teams in Office 365 for example. I also have a markdown file for each of my demo environments where I hold information about different personas I have created, areas where I have built out certain functionality and a basic changelog.

While I’m on the topic of VS Code extensions I think I will write another post and share my favourites VS Code extensions.

Hopefully, you got the Gist of things! See what I did there….I’ll get my coat.

Switch between modern SharePoint homepages using PnP PowerShell

This featured in Episode 44 of the SharePoint Dev Weekly podcast.

I’ve been working on a modern intranet project amongst over projects for the last 12-months. This has been more about the transformation of content and business processes, rethinking information architecture and reimagining a modern intranet than it has been about custom development.

I’ve been working on a modern intranet project amongst over projects for the last 12-months. This has been more about the transformation of content and business processes, rethinking information architecture and reimagining a modern intranet than it has been about custom development.

We’ve recently been testing variations in the design of a homepage with different audiences. This side-by-side comparison has allowed end-user feedback, performance and accessibility testing. The same approach has also been useful for previewing and testing the capabilities of new features (like the new Yammer web part). The challenge comes when you need to promote or switch over one of these variations as the new site homepage. The homepage is the page users are directed to when first navigating to a site or clicking on the site logo. It is like as important as the index.html or default.aspx page existence to a website. Note that these variations of the homepage permit testing of content and not site configuration. To test navigation, theme or similar we have separate sites and environments for this purpose.

To solve the problem switching the homepage from an existing page whilst preserving the home.aspx page name I’ve leveraged the SharePoint Pnp cmdlets to create a script that will rename or remove the current homepage (and can remove it through a toggle) and then rename an existing page to make it the new homepage.

Set-SPNewHomePage script demonstration
Demonstration of the Set-SPNewHomePage script in action.

Use my PnP PowerShell script to replace the home.aspx page

Alternative methods

Change the default homepage through SharePoint

Site Owners can use the out-of-the-box make homepage action to make any page the default homepage or welcome page. This is available from the toolbar in the site pages library. But this keeps the page name and means the default page is /sitepages/randompagename.aspx instead of the standard /sitepages/home.aspx that all sites have. From my perspective this is not great. Certainly, intranet-like sites should follow some basic content management principles. Call in a touch on the OCD side but consistently having a standard homepage is one of these for me.

Screenshot of setting a new homepage in the site pages library.
Screenshot of setting a new homepage in the site pages library.

Change the welcome page site property through Site Settings or PowerShell

Previously you could use the classic settings page (typically exposed by the publishing feature) or by browsing to /_layouts/15/AreaWelcomePage.aspx to make changes to the welcome page. This method no longer works and throws an error.

As with the make homepage action describe earlier this changes the default homepage to the use the page name you have provided and means the site won’t be available if users have bookmarked the site with the page name (/sitepages/home.aspx) in the URL.

Screenshot of the welcome page site settings page.
Screenshot of the welcome page site settings page.

What is my point? To this day can I still memory recall core settings pages. With these, you can quickly review or makes changes to settings pages rather than using the UI to navigate to them. This includes those that may no longer be exposed in the UI. Whilst my memory serves me well I don’t recommend this approach as these pages and settings are gradually being replaced with alternatives or removed by the SharePoint and Office 365 engineering team for a reason.

Instead, you can also use Pnp PowerShell to change the site welcome page property. I’ve provided an example script below.

As simple as my script is, it is the approach worth learning the most. I hope you find this article useful and as with all Pnp development effort. Sharing is caring!

How to daisy chain multiple monitors on a Surface Pro 3 running Windows 10

I finally decided to create my dream home office setup however it wasn’t without complications due to a strange limitation with the new Windows 10 display settings. I thought the idea of daisy chaining multiple displays on my Surface Pro 3 dock using the single DisplayPort was not going to be possible.

Let’s step back a few months. I recently upgraded to a Surface Pro 3 (SP3) and a dock to use when I’m working in my home office. I read from a few online sources that it was possible to connect multiple monitors to the SP3 through a single DisplayPort. This I thought was great, as I really dislike seeing lots of cables! While researching this subject I didn’t fund any specific reference any Dell U2913WM monitors and the SP3 happily working together. This post on the Surface blog was particularly helpful as it outlines the different ways multiple displays can be connected to the SP3. With this all this in mind, I filed DisplayPort Daisy Chaining to the back of my head to accompany my home office setup. Jump forward a couple of months and there’s no unboxing video of two 29″Dell (U2913WM) monitors but instead, a post to describe how I managed to set up two external displays with my Surface Pro 3 running Windows 10 via single DisplayPort and DisplayPort daisy chaining.

Here is a summary and sketch of how I’ve wired my Surface Pro 3 with two monitors:
– SP3 dock (mini DisplayPort out)
– Dell U2913WM #1 (DisplayPort in)
– Dell U2913WM #2 (Mini DisplayPort out from Primary to DisplayPort in)

Sketch of my Surface Pro 3 with two external displays
Sketch of my Surface Pro 3 with two external displays

I was pretty confident this would all be straight forward to set up, so much so I fixed the two monitors onto a vesa desk mount (more on this later) and carefully squirrelled all the cabling out of sight before I’d even switched them on, but who am I kidding! I docked the Surface Pro 3 only to find that two monitors would only allow me to duplicate them. For some reason, I just couldn’t get the new display settings menu on Windows 10 to allow me to run these as two separate displays even though it recognised them both.

Windows 10 Display Settings recognising three displays but only displaying two.
Windows 10 Display Settings recognising three displays but only displaying two.

After a little poking around, I discovered a setting (DisplayPort 1.2) in the control panel of the monitors. After enabling this, the displays all went blank for a moment while they reconfigured. But still no luck, I now had just one of the two external displays working, the other had no input.

Enabling Display Port 1.2 through the Dell U2913WM setting.
Enabling Display Port 1.2 through the Dell U2913WM setting.

This is the point I thought it just wasn’t going to work. I’d checked drivers. Restarted my SP3. Changed cables. Toggled Display Port 1.2 off and back on. As all techies would, I clicked around a fair bit. I found that from the new Windows 10 Display Settings screen, there were hits back to the old Control Panel. It was on this screen I noticed the winning link – Adjust resolution!

Enabling monitors on Windows 10.
Enabling monitors on Windows 10.

It was here I noticed that the third display was disabled. After enabling display, my SP3 was using all three displays! Excitement levels peaked at this point! It seems the new Windows 10 Display Settings screen does not display disconnected displays nor does it make it obvious to that you should use the Control Panel method. This is something I’ve shared with the Windows team via #WindowsInsider feedback and I hope is made easier in the future.

All three displays available.
All three displays available.

About that mount. I’m using a triple monitor vesa mount due to the sheer width of two 29″ monitors. The trick is not to use the middle mount that attaches to the upright bar but instead use the two side arms. The two monitors sit together perfectly with this mount! They’re sitting about 40cm high off the desk which gives me plenty of clearance underneath to use the physical desk space I have and at this height, I get support from the headrest on my high-backed chair.

One thing to note with this setup is that once DisplayPort 1.2 (DP 1.2) is enabled on either of the two monitors, the Dell Display Manager will not detect that display. The only way I’ve been able to get the tool working is to disable DisplayPort 1.2 on the secondary display. It’s a shame I can’t get the Display Manager tool to work as it is a really helpful tool to maximise on all the space the Dell U2913WM gives you. It allows you to easily snap windows to different areas of the display. I spent a short time researching the issue and it seems to be on Dell’s radar – not sure if this is specific to Windows 10 or DisplayPort 1.2 daisy-chained monitors or how soon it will be fixed but there was some guidance on the Dell Support forum.

#MSIgnite sessions available in a single spreadsheet

Update (31/01/15): Session spreadsheet updated and now includes 275 sessions.

Those involved with SharePoint, Office 365, Yammer, the communities and the wider industry will already know about the Ignite conference Microsoft has planned for May this year. Microsoft published the conference sessions on the Ignite website this afternoon, introduced through this Office Blog post.

The Office Blog post included a video from Julia White in which she shared what to expect from the conference. She also said in the video “without giving away too much, be the first to see a lot of new technology”, hinting that we will probably see the next versions of SharePoint and Exchange etc. The SharePoint Twitter account also shared the tweet below, with another video (#InBillWeTrust) confirming the next version of SharePoint (SharePoint 2016) will be shared during the conference.

The conference is just around the corner. At the time of writing this post, there are 272 sessions published on the website and I’m sure this will increase in the coming weeks and months. Over a year ago, I created a PowerShell script to help myself and others easily review all the sessions that were planned for the then SharePoint Conference (#SPC14).

You’ll be pleased to know I’ve done something similar again this year, although this year I’ve quickly gone about it using jQuery. I plan to create and share a bookmarklet but until then I’ve shared the first Ignite sessions spreadsheet for your viewing. The latest version of the sessions spreadsheet and jQuery bookmarklet are shared below.

MSIgnite Sessions Spreadsheet

Javascript via JSFiddle

Fingers crossed I can attend #MSIgnite and have the opportunity to meet the great people I met at #SPC14 again!