PoshCode Archive  Artifact Content

Artifact 5c3e6bb1575b634a74ccf825386ea5488521ad783db0f8f253ab9fb9f122eac5:

  • File Set-IseZoom.ps1 — part of check-in [c744f31a9b] at 2018-06-10 14:02:56 on branch trunk — Sets the ISE Zoom level to a range between 20 and 400. (user: mwjcomputing size: 1222)

# encoding: ascii
# api: powershell
# title: Set-IseZoom
# description: Sets the ISE Zoom level to a range between 20 and 400.
# version: 0.1
# type: function
# author: mwjcomputing
# license: CC0
# function: Set-IseZoom
# x-poshcode-id: 5863
# x-archived: 2015-05-22T03:53:25
# x-published: 2015-05-20T13:49:00
#
#
function Set-IseZoom {
  param(
    [Parameter(Mandatory=$true)]
    [ValidateRange(20,400)]
    [int]$ZoomAmount
  )
  
  Write-Verbose 'Starting Set-IseZoom'

  Write-Verbose "Setting zoom percentage to $ZoomAmount"
  $psISE.Options.Zoom=$ZoomAmount

  if ($psISE.Options.Zoom -ne $ZoomAmount) {
    Write-Warning -Message "Unable to set ISE Zoom level to $ZoomAmount"
  }

  Write-Verbose 'Stopping IseZoom'

  
    <#    
    .SYNOPSIS
        This function sets the zoom level in the PowerShell ISE.
    .DESCRIPTION
        This function uses the ISE object model to set the zoom level to the specified value.
    .EXAMPLE
        Set-IseZoom -ZoomAmount 150
    .NOTES
        Written by Matt Johnson (@mwjcomputing)
    .LINK
        http://www.mwjcomputing.com/
    .LINK
        https://technet.microsoft.com/en-us/library/dd819500.aspx
    #>

}