This file contains hidden or 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
| require.config({ | |
| paths: { | |
| "app": "../app" | |
| } | |
| }); | |
| require(['splunkjs/mvc/simplexml/ready!'], function(){ | |
| require(['splunkjs/ready!'], function(){ | |
| // The splunkjs/ready loader script will automatically instantiate all elements | |
| // declared in the dashboard's HTML. |
This file contains hidden or 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[]]$ComputerName = ".", | |
| [Parameter(Mandatory)] | |
| [Management.Automation.Credential()] | |
| [PSCredential]$Credential | |
| ) | |
| $sessions = New-PSSession -ComputerName:$ComputerName -Credential:$Credential |
This file contains hidden or 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 Test-DebugPreference { | |
| [CmdletBinding()] | |
| param($count = 1e5) | |
| $Counter = 0 | |
| for($i = 0; $i -lt $count; $i++) { | |
| if($DebugPreference -gt "SilentlyContinue") { | |
| $Counter += 1 | |
| Write-Debug "The Counter is $Counter" | |
| } |
This file contains hidden or 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 filesystem { | |
| param( | |
| [Parameter(ParameterSetName="Dirs",ValueFromPipeline)] | |
| [System.IO.DirectoryInfo]$Directory, | |
| [Parameter(ParameterSetName="Files",ValueFromPipeline)] | |
| [System.IO.FileInfo]$File | |
| ) | |
| process { | |
| switch ($PSCmdlet.ParameterSetName) { |
This file contains hidden or 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
| &{ | |
| [CmdletBinding()]param() | |
| &{[CmdletBinding()]param() Write-Error "Demo Error 1" } -EA 0 -EV e; | |
| $PSCmdlet.WriteError($e[0]); | |
| 1/0 | |
| &{[CmdletBinding()]param() Write-Error "Demo Error 2" } -EA 0 -EV e; | |
| $PSCmdlet.ThrowTerminatingError($e[0]) |
This file contains hidden or 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
| [324]: try { | |
| 路 try{ | |
| 路 throw [System.Management.Automation.ParameterBindingException]::new( "whatever", | |
| 路 [System.Management.Automation.ItemNotFoundException]::new("File Not Found")) | |
| 路 } catch{ throw $_} | |
| 路 } catch [System.Management.Automation.ParameterBindingException] { "PBE" } | |
| 路 catch [System.Management.Automation.ItemNotFoundException] { "INFE" } | |
| PBE | |
| [325]: |
This file contains hidden or 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
| def testPalindrome(p): | |
| p = str(p) | |
| return not any([True for i in range(0,len(p)/2) if p[i] <> p[-i-1]]) |
This file contains hidden or 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
| PS> mkdir ClassContainer | |
| Directory: C:\Users\Joel\Documents\WindowsPowerShell\TestData\modules | |
| Mode LastWriteTime Length Name | |
| ---- ------------- ------ ---- | |
| d----- 11/23/2015 7:41 PM ClassContainer |
This file contains hidden or 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
| <?xml version="1.0" encoding="utf-8"?> | |
| <feed xml:base="http://bd-xd7-01/Citrix/Monitor/OData/v1/Data/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> | |
| <id>http://bd-xd7-01/Citrix/Monitor/OData/v1/Data/Sessions</id> | |
| <title type="text">Sessions</title> | |
| <updated>2014-01-08T20:19:50Z</updated> | |
| <link rel="self" title="Sessions" href="Sessions" /> | |
| <entry> | |
| <id>http://bd-xd7-01/Citrix/Monitor/OData/v1/Data/Sessions(guid'5a84b30a-9190-4013-b458-81d64633c996')</id> | |
| <category term="Citrix.Monitor.Repository.Session" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> | |
| <link rel="edit" title="Session" href="Sessions(guid'5a84b30a-9190-4013-b458-81d64633c996')" /> |
This file contains hidden or 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
| // You can output any simple .Net Object that you like | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Management.Automation; | |
| namespace PoshCode | |
| { | |
| // A data object we're going to output | |
| public class Vehicle | |
| { |
OlderNewer