Skip to content

Instantly share code, notes, and snippets.

<#
.SYNOPSIS
Disables services not required in Windows Server 2016.
.DESCRIPTION
Disables services not required to increase security of the system.
.PARAMETER ComputerName
@NamedJason
NamedJason / Find-Orphans.ps1
Last active October 6, 2023 07:09
Finds Orphaned VMDK Files
# Powershell script to discover VMDK files that are not referenced in any VM's VMX file.
# Warning - I've heard reports that this doesn't work on some versions of ESXi and have no had time to troubleshoot/test it.
# Also detects VMDKs from machines that need snapshot consolidation (from differentials that exist but are not part of the tree).
# Author: HJA van Bokhoven
# Modifications: LucD
function LoadSnapin{
param($PSSnapinName)
if (!(Get-PSSnapin | where {$_.Name -eq $PSSnapinName})){
Add-pssnapin -name $PSSnapinName
@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
@dfch
dfch / ### PowerShell modules, digital signatures, NuGet nuspec and packages.md
Last active January 1, 2022 20:19
PowerShell modules, digital signatures, NuGet nuspec and packages

PowerShell modules, digital signatures, NuGet nuspec and packages

d-fens GmbH General-Guisan-Strasse 6 CH-6300 Zug Switzerland

@dfch
dfch / Invoke-SqlCmd.ps1
Created October 19, 2014 18:38
[biz.dfch.PS.System.Data] Invoke-SqlCmd without the overhead
# [biz.dfch.PS.System.Data] Invoke-SqlCmd without the overhead
# http://d-fens.ch/2013/11/26/biz-dfch-ps-system-data-invoke-sqlcmd-without-the-overhead
function Invoke-SqlCmd {
[CmdletBinding(
SupportsShouldProcess=$true,
ConfirmImpact="Medium",
HelpURI='http://dfch.biz/PS/System/Data/Invoke-SqlCmd/'
)]
Param (
@dfch
dfch / Invoke-CteraFileTransfer.ps1
Last active August 29, 2015 14:06
biz.dfch.PS.Storebox.Api: Invoke-CteraFileTransfer
// http://d-fens.ch/2013/11/27/biz-dfch-ps-storebox-api-invoke-cterafiletransfer/
// Check https://github.com/dfch/biz.dfch.PS.Storebox.Api for the complete repository of this module
function Invoke-CteraFileTransfer {
[CmdletBinding(
SupportsShouldProcess=$true,
ConfirmImpact="High",
HelpURI='http://dfch.biz/PS/Storebox/Api/Invoke-CteraFileTransfer'
)]
[OutputType([string])]
Param (
@Antarix
Antarix / TypeWriter.java
Last active March 4, 2021 06:12
TextView animation like type writer
import android.content.Context;
import android.os.Handler;
import android.util.AttributeSet;
import android.widget.TextView;
public class TypeWriter extends TextView {
private CharSequence mText;
private int mIndex;
private long mDelay = 150; //Default 150ms delay