page contents

About the Post

Author Information

PowerShell Script to create a Shutdown/Restart/Logoff Windows 8 Tile for the Start menu

One of my more popular articles on this site, is the Finding the Start Menu in Windows Server 2012. It walks you through the basic changes of the new start menu. Most of the complaints that I have heard is that it hard to quickly reboot, shutdown or logoff a system or it is hard to find a program.

Here is how the start menu logs with no changes:

Today, I will help you with the first one and to solve that you will have 2 options:

  1. Use the command line to perform those tasks
  2. Use PowerShell to create a tile for those actions

To quickly get started, press Windows Key + r to open the run command and then type cmd:

Then use these commands to perform the following:

  • Log off: logoff
  • Reboot: shutdown –r –f –t 0 (Reboot, force, time)
  • Shutdown: shutdown –s –f –t 0

The cooler method is one I found on the MS Scripting Guys blog and it seems to be a real big hit for them as well. They even made a video to help you create these new tiles on the Start Menu, but it seems to take a bit longer.

The first step is to download the script in the middle of the link:

Then agree
to the license agreement:

Download and save the file, then extract it. I choose the default downloads folder (C:\Users\username\Downloads) You will see these 3 files:

Step 1: Type Import-Module C:\Users\username\Downloads\CreateWindowsTile\CreateWindowsTile.psm1

Step 2: Type New-OSCWindowsTile command in the Windows PowerShell Console.

This command will create a shutdown, restart and logoff Windows 8 tile to the Start menu. (As seen below)

Before running this script and commands, make sure that you have allowed as mentioned in an earlier article called HOW TO: Set the PowerShell Execution Policy. For more details, please see this article on TechNet: Using the Set-ExecutionPolicy Cmdlet or just look at the quick highlights below:

Changing the Windows PowerShell Script Execution Policy

The Set-ExecutionPolicy cmdlet enables you to determine which Windows PowerShell scripts (if any) will be allowed to run on your computer. Windows PowerShell has four different execution policies:

•Restricted– No scripts can be run. Windows PowerShell can be used only in interactive mode.

•AllSigned– Only scripts signed by a trusted publisher can be run.

•RemoteSigned– Downloaded scripts must be signed by a trusted publisher before they can be run.

•Unrestricted– No restrictions; all Windows PowerShell scripts can be run.

To assign a particular policy simply call Set-ExecutionPolicy followed by the appropriate policy name. For example, this command sets the execution policy to RemoteSigned:

Set-ExecutionPolicy RemoteSigned

Note: The video actually does these steps, which will allow you to add one tile at a time.

Step 1: Type Import-Module C:\Users\user\Downloads\CreateWindowsTile\CreateWindowsTile.psm1

Step 2: Type New-OSCWindowsTile -ShutdownTile command in the Windows PowerShell Console.

Step 3: Type New-OSCWindowsTile -RestartTile command in the Windows PowerShell Console.

Step 4: Type New-OSCWindowsTile -LogoffTile command in the Windows PowerShell Console.

This command will create a shutdown, restart and log-off Windows 8 tile to the Start menu.

Tags: , , , , , , , , ,

Comments are closed.

Copy Protected by Chetan's WP-Copyprotect.