Skip to content

Instantly share code, notes, and snippets.

View PSingletary's full-sized avatar
🔍
Search

PSingletary PSingletary

🔍
Search
View GitHub Profile
Get-WmiObject win32_operatingsystem | select csname, @{LABEL=’LastBootUpTime’;EXPRESSION={$_.ConverttoDateTime($
_.lastbootuptime)}}
@PSingletary
PSingletary / mklink.psm1
Created April 3, 2019 14:58 — forked from jpoehls/mklink.psm1
Native PowerShell wrapper for MKLINK.
@PSingletary
PSingletary / Shop-Tech.opml
Created April 2, 2019 19:40
OPML for my shopping rss feeds
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Shopping RSS feeds</title>
</head>
<body>
<outline text="shopping" title="shopping">
<outline type="rss" text="Ben's Bargains - Latest Headline..." title="Ben's Bargains - Latest Headline..." xmlUrl="http://bensbargains.net/rss/" htmlUrl="https://bensbargains.com/rss/"/>
<outline type="rss" text="Product Alerts for patricksingletary by camelcamelcamel" title="Product Alerts for patricksingletary by camelcamelcamel" xmlUrl="http://camelcamelcamel.com/alerts/a818ed5e4c98ba6e5e7b2a61aea9424ed2c1c064.xml" htmlUrl="https://camelcamelcamel.com/alerts/a818ed5e4c98ba6e5e7b2a61aea9424ed2c1c064.xml"/>
@PSingletary
PSingletary / Log-NewFolderCreator.ps1
Last active March 7, 2019 02:32
Find creator of “New Folder” * write to windows event log with 101337
$Drives = Get-PSDrive -PSProvider 'FileSystem'
foreach($Drive in $Drives) {
Get-ChildItem -Path $Drive.Root -Recurse -File -ErrorAction SilentlyContinue -Force | Where-Object { ($_.PSIsContainer -eq $true) -and ( $_.Name -like "*New Folder*") } |
Get-Acl "folder path" | Select-Object Owner }
##################################################################################################################
##RemoteImport-Certificate.ps1
##Description: Script imports a certificate into all remote servers specified in the
#+ "servers.txt" inputlist.
#+ Fill out the "parameters" section according to your needs before running!
##Created by: Noam Wajnman
##Creation Date: March 17, 2014
###################################################################################################################
#VARIABLES
$scriptpath = $MyInvocation.MyCommand.Path
Add-ADGroupMember -Identity 'New Group' -Members (Get-ADGroupMember -Identity 'Old Group' -Recursive)
@PSingletary
PSingletary / Get-Something.ps1
Created February 12, 2019 20:20 — forked from jdhitsolutions/Get-Something.ps1
My PowerShell function template for getting information from remote computers. The file also contains a json entry for a PowerShell snippet in VSCode.
Function Get-Something {
<#
.SYNOPSIS
Get something
.DESCRIPTION
Describe what this does.
Many of the parameters are the same as in Invoke-Command.

“search term” Force an exact‐match search. Use this to refine results for ambiguous searches, or to exclude synonyms when searching for single words.

Example: “steve jobs”

OR Search for X or Y. This will return results related to X or Y, or both. Note: The pipe (|) operator can also be used in place of “OR.”

Examples: jobs OR gates / jobs | gates

@PSingletary
PSingletary / BoxPrompt.ps1
Created January 19, 2019 00:16 — forked from jdhitsolutions/BoxPrompt.ps1
A fancy PowerShell prompt function that should work cross-platform. See script comments for more information.
#requires -version 5.1
<#
Create a lined box with user and location information. The line color will indicate if the user is running elevated.
The prompt will also display the current date and time and a PS prompt with the PowerShell version.
┌─────────────────────────┐
│ [BOVINE320\Jeff] D:\iso │
└─────────────────────────┘
[01/18/2019 09:30:53] PS v6.1.2>