This file contains 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
<# | |
.Synopsis | |
Rough PS functions to create new user profiles | |
.DESCRIPTION | |
Call the Create-NewProfile function directly to create a new profile | |
.EXAMPLE | |
Create-NewProfile -Username 'testUser1' -Password 'testUser1' | |
.NOTES | |
Created by: Josh Rickard (@MS_dministrator) | |
Date: 24MAR2017 |
This file contains 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 Find-Window { | |
[CmdletBinding()]Param ( | |
[string]$WindowName, | |
[int]$Retries = 10, | |
[int]$SleepInterval = 1000 | |
) | |
[int]$CurrentTry = 0; | |
[bool]$WindowsFound = $false; |
This file contains 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 Do-SendKeys { | |
param ( | |
$SENDKEYS, | |
$WINDOWTITLE | |
) | |
$wshell = New-Object -ComObject wscript.shell | |
IF ($WINDOWTITLE) {$wshell.AppActivate($WINDOWTITLE)} | |
Start-Sleep -Milliseconds 500 | |
IF ($SENDKEYS) {$wshell.SendKeys($SENDKEYS)} | |
} |
This file contains 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-Hash | |
{ | |
<# | |
.SYNOPSIS | |
Get-Hash is a PowerShell Version 2 port of Get-FileHash that supports hashing files, as well as, strings. | |
.PARAMETER InputObject | |
This is the actual item used to calculate the hash. This value will support [Byte[]] or [System.IO.Stream] objects. |
This file contains 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
<# | |
Put together by Erick Sevilla: erick.sevilla@atos.net | |
Script to get installed software on remote machines. | |
Requires Hosts.txt file to feed server list in same folder as script | |
Output results in same folder | |
Added Parallel processing | |
#> | |
$Servers = Get-Content $PSScriptRoot\Hosts.txt |
This file contains 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
# Regex 1: https://regex101.com/r/Y3HJSf/2 | |
# Regex 2: https://regex101.com/r/DQ9H7b/2 | |
#Table | |
$Settings = ( | |
"HP EliteBook 830 G5,01.11.01", | |
"HP EliteBook 840 G5,01.11.01", | |
"HP EliteBook 840 G6,01.05.03", | |
"HP EliteBook x360 1030 G2,01.34", | |
"HP EliteBook x360 1030 G3,01.11.01", |
This file contains 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
# Copyright (c) 2014 Atif Aziz. All rights reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
This file contains 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
<# | |
Ping Machines Script | |
Draft to use as reference for Homework | |
#> | |
$Computers = Get-Content 'C:\Temp\Hosts.txt' | |
$Output = 'C:\Temp\Results.txt' | |
$var = foreach ($Computer in $Computers) { | |
if (Test-Connection -ComputerName $Computer -Count 1 -Quiet) { |
This file contains 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 declaration | |
function Get-SpotifyTitle { | |
[cmdletbinding()] param([string]$TrackUri) | |
$Cont = Invoke-WebRequest -Uri $TrackUri | |
$Title = $Cont.ParsedHTML.Title | |
$SplitTitle = $Title -split ', a song by ' | |
$Song = $SplitTitle[0] | |
$Artist = $SplitTitle[1] -replace ' on Spotify' |
This file contains 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
<# PowerShell Script to convert dbf file to csv (or almost anything else, really) without Excel. | |
Requires dBASE.NET.dll assembly: https://github.com/henck/dBASE.NET | |
This is a draft | |
#> | |
$Source = "$PSScriptRoot\da_md_wpa.dbf" # dbf file | |
$dll = "$PSScriptRoot\dBASE.NET.dll" # Assembly | |
$BaseName = (Get-Item $Source).BaseName | |
$Count = $null |
NewerOlder