This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach($O in "Win32_operatingsystem","win32_bios"){if($O -eq "win32_bios"){$r+=(gwmi $O|select @{E="Serialnumber";L="BIOS Serialnumber"},Pscomputername,@{E={$r.servicepackmajorversion};L="servicepackmajorversion"},@{E={$R.version};L="version"})} else{[array]$r+=(gwmi $O|select @{E={""};L="Serialnumber"},Pscomputername,servicepackmajorversion,version)};$R[1]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gwmi win32_operatingsystem|select CSname,Version,@{E={(gwmi win32_bios).serialnumber};L="Bios SerialNumber"},servicePackMajorVersion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Invoke-WebRequest -Uri www.telize.com/geoip|select -ExpandProperty content|ConvertFrom-Json|select longitude,latitude,country_code,timezone | |
function Get-GeoInformation | |
{ | |
[CmdletBinding()] | |
[Alias('ggeo')] | |
param( | |
[Parameter(ValueFromPipeLine=$true)] | |
[ValidateNotNull()] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Cred=Get-Credential;import-csv C:\powershell.org\Input.csv|select -ExpandProperty machinename |foreach{new-object psobject -Property @{'MACHIUNENAME'=$_;'OS VERSION'=$(Get-WmiObject -Class win32_operatingsystem -ComputerName $_ -Credential $cred|select -ExpandProperty caption)}}|Export-Csv C:\powershell.org\Output.csv -NoTypeInformation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Shows you the RSS Feeds for given URI. | |
.DESCRIPTION | |
This cmdlet Shows you RSS Feeds for a given URI.Results for this cmdlet includes Title,Link and a Short Description for specified Link. | |
.EXAMPLE | |
PS C:\WINDOWS\system32> Get-RSSFeed -Uri http://blogs.msdn.com/powershell -OutFilePath C:\Users\PR615733\Documents\RssFeedExample1.csv -OpenAfterExecution -Verbose | |
Title Link | |
----- ---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-Uptime{ | |
[CmdletBinding()] | |
param( | |
[Parameter(ValueFromPipeline = $true)] | |
[String[]]$ComputerName = $env:COMPUTERNAME | |
) | |
Begin | |
{ | |
$Output=@() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
This script will help to create expressions for logging the input values of a PowerShell script. | |
.DESCRIPTION | |
This script will help to create expressions for logging the input values of a PowerShell script. | |
.EXAMPLE | |
PS C:\> .\Build-ParamLog.ps1 -Script C:\Test.PS1 -Prefix Log | |
Above execution will create expressions with prefix Log, see below. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param( | |
[String]$OutFilePath | |
) | |
Add-type -AssemblyName System.Drawing | |
$VirtualScreen = [System.Windows.Forms.SystemInformation]::VirtualScreen | |
$Bmp = New-Object System.Drawing.Bitmap $VirtualScreen.Width, $VirtualScreen.Height | |
$Graphic = [System.Drawing.Graphics]::FromImage($bmp) | |
$Graphic.CopyFromScreen($VirtualScreen.Left, $VirtualScreen.Top, 0, 0, $Bmp.Size) | |
$Bmp.Save($OutFilePath) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#PSScriptInfo | |
.VERSION 1.0.0 | |
.GUID 3b5ee706-249d-4108-8126-c8692d603ebc | |
.AUTHOR Jeffrey Snover | |
.COMPANYNAME Microsoft Corporation | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
[Parameter(Mandatory = $True)] | |
[string]$ConfigPath | |
) | |
$Config = Get-Content -Path $ConfigPath | ConvertFrom-Json | |
Describe "Describing validation tests post deployment" { | |
Context "Post deployment validation tests for services" { | |
BeforeAll { |
OlderNewer