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
echo 'Hello World' | |
stage "build" | |
node { | |
git 'https://github.com/jenkinsci/docker' | |
bat """ | |
dir | |
""" | |
} |
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
$data = [system.IO.Streamwriter] "C:\Scripts\sample2.txt" | |
1..10000 | foreach { | |
$data.writeline($_) | |
} | |
$data.Close() |
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
1..10000 | foreach { | |
$_ | out-file C:\Scripts\sample1.txt -Append | |
} |
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
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 |
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
$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 |
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 Get-TransferTime | |
{ | |
[CmdletBinding()] | |
Param | |
( | |
[Long] | |
$FileSizeGb, | |
$FileSizeTb | |
) |
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
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' |
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
$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 | |
} |
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
$Global:Hello | |
$computers1 = 1..5 | |
#Define variable | |
$DellSystemInfo = $Null | |
$time1 = '1001' |
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 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 |