Skip to content

Instantly share code, notes, and snippets.

View ctmcisco's full-sized avatar
🏠
Working from home

Francisco Navarro ctmcisco

🏠
Working from home
View GitHub Profile
@dfinke
dfinke / Get-ContentJson.ps1
Last active September 15, 2021 19:23
This function works like PowerShell's builtin cmdlet Get-Content, except, if you pass in a file that contains JSON, it will convert it for you. If for example, you are working with npm modules (node.js packages), they have a file package.json that are used for configuration information. So you can use it like this: ls . -recurse *.json | Get-Con…
function Get-ContentJson {
<#
.Synopsis
Get-ContentJson reads a json file, converts it an returns the object
.Example
ls . -recurse *.json | Get-ContentJson
.Example
Get-ContentJson (dir . *.json).fullname
#>
param(
@bertspaan
bertspaan / README.md
Created January 2, 2014 15:28
Python script to convert DBF database file to CSV
@MagicAndi
MagicAndi / Install-Programs
Created April 22, 2014 21:18
A Chocolatey PowerShell script to install programs to a newly paved Windows 8 machine, including development tools. Based on a gist from @amogram (https://gist.github.com/amogram/8217460)
# ==========================================================================
#
# Script Name: Install-Programs.ps1
#
# Author: Andy Parkhill
#
# Date Created: 27/03/2014
#
# Description: A simple environment setup script for my personal laptop.
#
@liveaverage
liveaverage / Set-Dhcp-Scope.ps1
Created July 30, 2014 20:55
Powershell wrapper for netsh and dnscmd functions used for DHCP scope creation.
############################
#AUTHOR: JR Morgan
#CREATED: 20120417
#MODIFIED: 20140611
############################
<#
.Synopsis
Adds DHCP Scope to ALL specified DHCP servers. If split-scope is desired
the script uses IP Math to automatically add the desired exlcude ranges.
@omidkrad
omidkrad / ExecJavaScript.ps1
Last active April 10, 2023 18:12
PowerShell function to run JavaScript/JQuery and return results back to PS, with timeout
# PowerShell function to run JavaScript/JQuery and return results back to PS, with timeout
# some web page with jQuery in it
$url = "http://jquery.com/"
Function ResetTimer
{
$script:startTime = [DateTime]::Now
}
@flcdrg
flcdrg / boxstarter-bare-v3.ps1
Last active March 25, 2024 01:47
My BoxStarter Scripts
# 1. Install Chocolatey
<#
Set-ExecutionPolicy RemoteSigned -Force
# Create empty profile (so profile-integration scripts have something to append to)
if (-not (Test-Path $PROFILE)) {
$directory = [IO.Path]::GetDirectoryName($PROFILE)
if (-not (Test-Path $directory)) {
New-Item -ItemType Directory $directory | Out-Null
}
@dfinke
dfinke / ConvertFrom-JsonToCsv.ps1
Created February 16, 2015 14:28
Using PowerShell to Convert From JSON to CSV format
function ConvertFrom-JsonToCsv {
param(
[Parameter(ValueFromPipeline)]
$json
)
Process {
($json | ConvertFrom-Json) | ConvertTo-Csv -NoTypeInformation
}
}
@NickCraver
NickCraver / Windows10-Setup.ps1
Last active April 1, 2024 10:52
(In Progress) PowerShell Script I use to customize my machines in the same way for privacy, search, UI, etc.
##################
# Privacy Settings
##################
# Privacy: Let apps use my advertising ID: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0
# To Restore:
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1
# Privacy: SmartScreen Filter for Store Apps: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 0
@davefunkel
davefunkel / Script-Template-WithCreds.ps1
Last active May 23, 2024 07:01
PowerShell Script Template with Saved Creds
<#
.SYNOPSIS
The synopsis goes here. This can be one line, or many.
This version of the template has inbuilt functions to capture credentials and store it securely for reuse
Avoids the need to have plaintext passwords in the script
.DESCRIPTION
The description is usually a longer, more detailed explanation of what the script or function does.
Take as many lines as you need.
@matthewjberger
matthewjberger / DisplayFonts.ps1
Created July 29, 2016 16:20
PowerShell Font Listing
# From https://technet.microsoft.com/en-us/library/ff730944.aspx
# This will open an internet explorer window that will display all installed windows font names in their corresponding font.
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
$objFonts = New-Object System.Drawing.Text.InstalledFontCollection
$colFonts = $objFonts.Families
$objIE = New-Object -com "InternetExplorer.Application"
$objIE.Navigate("about:blank")
$objIE.ToolBar = 0