Skip to content

Instantly share code, notes, and snippets.

View gabrielrojasnyc's full-sized avatar

Gabriel Rojas gabrielrojasnyc

View GitHub Profile
echo 'Hello World'
stage "build"
node {
git 'https://github.com/jenkinsci/docker'
bat """
dir
"""
}
@gabrielrojasnyc
gabrielrojasnyc / powershellsystemclass.ps1
Created March 27, 2016 20:51
powershellsystemclass
$data = [system.IO.Streamwriter] "C:\Scripts\sample2.txt"
1..10000 | foreach {
$data.writeline($_)
}
$data.Close()
1..10000 | foreach {
$_ | out-file C:\Scripts\sample1.txt -Append
}
Start-Job -ScriptBlock {
$TimeStamp = get-date -Format MMddyy'T'HHmm
$Counters = "\Processor(*)\% Processor Time", "\LogicalDisk(C:)\Disk Reads/sec", "\Memory\Pages/sec", "\memory\available mbytes", "\TCPv4\Segments/sec"
Get-Counter -Continuous $Counters | Export-Counter C:\Counters\counter"$timestamp".blg -Force
} -Name Counter
$TimeStamp = get-date -Format MMddyy'T'HHmm
$Counters = "\Processor(*)\% Processor Time", "\LogicalDisk(C:)\Disk Reads/sec", "\Memory\Pages/sec", "\memory\available mbytes", "\TCPv4\Segments/sec"
Get-Counter -Continuous $Counters | Export-Counter C:\Counters\counter"$timestamp".blg -Force
function Get-TransferTime
{
[CmdletBinding()]
Param
(
[Long]
$FileSizeGb,
$FileSizeTb
)
@gabrielrojasnyc
gabrielrojasnyc / DSC
Created January 6, 2016 02:13
DSC GPO resources
Configuration MODGPO {
param($NodeVM)
Node $NodeVM {
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System'
ValueName = 'LegalNoticeCaption'
ValueData = 'This system is proctected by State and Federal law'
$local:Hello
$time1 = '1001'
Get-Service -ComputerName $env:COMPUTERNAME -Name BcmBtRSupport
function Show-Message {
Write-Information "Hello World" -InformationAction Continue
Write-Information "Test 1,2,3 $time1" -InformationAction Continue
}
$Global:Hello
$computers1 = 1..5
#Define variable
$DellSystemInfo = $Null
$time1 = '1001'
@gabrielrojasnyc
gabrielrojasnyc / gist:60b95f734f4b5e14a4f7
Created December 29, 2015 14:20
Dell Warranty Information
# you can replace this with list of servers
#$computers = 1..5 this was for testing purposes
$computers = Get-Content C:\Scripts\test.txt
#Define variable
$DellSystemInfo = $Null
foreach ($node in $computers){
# Get Dell Server serviceTag
$ServiceTag1 =(Get-CimInstance -ComputerName $node -ClassName Win32_ComputerSystemProduct).identifyingNumber