Saturday, December 28, 2013

Backup Windows 8.1

Here is a short little PowerShell Function that I use to create a scheduled job that runs every night at midnight that backups my C:\ drive to my E:\ drive.

The code used to backup Windows 8.1:
wbAdmin start backup -backupTarget:E: -include:C: -quiet

Function Create-ScheduledJob {
<#
.Synopsis
   schedules nightly backups.
.FUNCTIONALITY
   PowerShell v3.0+
#>
[CmdletBinding()]
    Param( [Parameter( Mandatory = $True )]
           $JobName,
           [Parameter( Mandatory = $True )]
           $ScriptToRun,
           $VerbosePreference = "Continue" )

Begin{ $Trigger = (New-JobTrigger -Daily -At 12:01AM) }

Process{ Register-ScheduledJob -Name $JobName -Trigger $Trigger -ScriptBlock { "& wbAdmin start backup -backupTarget:E: -include:C: -quiet" } }

End { Write-Verbose "Your new ScheduledJob has been created successfully!" }

}Create-ScheduledJob


Monday, December 23, 2013

Skip Windows Metro UI at boot

Here is a short PowerShell function that will make Windows boot right to the Desktop; skipping the Metro UI!

Function Disable-MetroAtBoot {
<#
.Synopsis
   Disables Windows booting to the Metro Desktop.
.DESCRIPTION
   Disables Windows booting to the Metro Desktop by modifying the registry. Windows will boot to the Desktop after running this function.
.EXAMPLE
   Disable-MetroAtBoot
   After loging out and back into windows you will have 3 rows on your Windows Metro desktop.
.EXAMPLE
   Disable-MetroAtBoot -Verbose
   After loging out and back into windows you will have 1 row on your Windows Metro desktop.
.NOTES
   After running this script the next time you log into Windows, the first thing you will see is the desktop and not the Metro desktop.
.FUNCTIONALITY
   Windows 8, Windows 8.1
#>
[CmdletBinding()]
          Param ( $VerbosePreference = "Continue" )
    
Begin{ $RegLocation = "HKCU:\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StartPage" }

Process{ New-ItemProperty $RegLocation -Name "OpenAtLogon" -Value 0 -PropertyType "DWord" }

End { Write-Verbose "Next time you log into Windows; Windows will boot right to the Desktop!" }

}Disable-MetroAtBoot -Verbose


Tuesday, December 10, 2013

Change number of rows on Windows 8 metro desktop

Do you have Windows 8 installed? Would you like to customize your Computers Desktop? Download this short PowerShell function to modify the amount of rows you Windows Metro Desktop will display.

I've got some good new, some not so good news and some bad news;

       

Good:

If you have Windows 8 this opens up an awesome ability to customize your Metro Desktop.

       

Not so good:

I have yet to get this to work in Windows 8.1. There is however a possible workaround as in some copies of Windows 8.1 you are able to Charms Bar > Settings > Tiles > Show More Tiles Change to 'Yes'. This option is only found in specific Versions of  Windows 8.1, sadly I have not came to a defiant reasoning to what allows this option

       

Bad:

You must sign out of your Windows account and back in for the change to take effect.

Simply copy the below code into an Administrative PowerShell console by right clicking on PowerShell.exe and then left clicking on 'Run as an Administrator.'

Function Set-MetroRows {
<#
.Synopsis
   Changes the number of rows on Windows 8 metro desktop 
.DESCRIPTION
   Changes the number of rows on Windows 8 metro desktop by modifying the registry
.EXAMPLE
   Set-MetroRows -Rows 3
   After loging out and back into windows you will have 3 rows on your Windows Metro desktop.
.EXAMPLE
   Set-MetroRows -Rows 1
   After loging out and back into windows you will have 1 row on your Windows Metro desktop.
.NOTES
   You must logout\sign out and back into Windows for the registry changes to take effect.
.FUNCTIONALITY
   PowerShell v3.0+
#>
[CmdletBinding()]
          Param ( [Parameter(Mandatory=$True,
                   ValueFromPipelineByPropertyName=$true,
                   Position=0)]
                   $Rows,
                   $VerbosePreference = "Continue" )
    
Begin{ Remove-ItemProperty "HKCU:\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ImmersiveShell\Grid" -Name "Layout_MaximumRowCount" }

Process{ New-ItemProperty "HKCU:\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ImmersiveShell\Grid" -Name "Layout_MaximumRowCount" -Value $Rows -PropertyType "DWord" }

End { Write-Verbose "Please Press Enter to sign out of windows, once logged back in the changes will be in place!" ; Pause ; shutdown /l }

} Set-MetroRows -Rows 3
The amount of rows that you can have is determined by your screen resolution.(see chart below)
Screen Resolution (HxV)DefaultMaxMin
800 x 600331
1024 x 768441
1152 x 864551
1280 x 720441
1280 x 900551
1280 x 960561
1280 x 1024561
1440 x 900551
1600 x 900551
1680 x 1050661
1900 x 1080561
1920 x 1080661
1920 x 1200671
2560 x 19206101
Examples: