Skip to content

Instantly share code, notes, and snippets.

View gabrielrojasnyc's full-sized avatar

Gabriel Rojas gabrielrojasnyc

View GitHub Profile
$Global:Hello
$computers1 = 1..5
#Define variable
$DellSystemInfo = $Null
$time1 = '1001'
$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
}
@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'
function Get-TransferTime
{
[CmdletBinding()]
Param
(
[Long]
$FileSizeGb,
$FileSizeTb
)
$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
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
1..10000 | foreach {
$_ | out-file C:\Scripts\sample1.txt -Append
}
@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()
echo 'Hello World'
stage "build"
node {
git 'https://github.com/jenkinsci/docker'
bat """
dir
"""
}
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {
"storageAccountName": "virginadraassa"
},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",