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
param( | |
[string] $dataSource = "$PSScriptRoot\dbf\da_md_wpa.dbf", # path to dbf file | |
[string] $sqlCommand = "SELECT * FROM [da_md_wpa$]", # Sheet/Table Name | |
[System.Management.Automation.PsCredential] $credential | |
) | |
$authentication = "Integrated Security=SSPI;" | |
if($credential) | |
{ | |
$plainCred = $credential.GetNetworkCredential() |
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
# This is just an example, AutoIT is more robust, but safety measures and error handling to make this more robust can definitely be scripted, e.g. monitor events for actions, monitor processes, wait for, validations etc. | |
Add-Type -AssemblyName Microsoft.VisualBasic | |
Add-Type -AssemblyName System.Windows.Forms | |
start cmd | |
start-sleep -Seconds 1 | |
[Microsoft.VisualBasic.Interaction]::AppActivate(“cmd.exe”) | |
start-sleep -Seconds 1 | |
[System.Windows.Forms.SendKeys]::SendWait(“Hello”) |
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
# Sample: Get user's AD group membership without AD module | |
$username = 'username' # username | |
$email = 'user@email.com' # email goes here | |
<# | |
# Example with .NET class: | |
$Search = New-Object System.DirectoryServices.DirectorySearcher("(&(ObjectCategory=Person)(ObjectClass=User)(cn=$username))") | |
$results = $Search.FindAll() | |
$results.properties["Memberof"] |
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
# Load assemblies | |
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") | |
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | |
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Wind") | |
[void] [System.Windows.Forms.Application]::EnableVisualStyles() | |
# Start functions | |
function YourFunction($var){ | |
$command = {param($var) |
http://www.oreilly.com/programming/free/files/microservices-for-java-developers.pdf
http://www.oreilly.com/programming/free/files/microservices-for-java-developers.epub
http://www.oreilly.com/programming/free/files/microservices-for-java-developers.mobi
http://www.oreilly.com/programming/free/files/modern-java-ee-design-patterns.pdf
http://www.oreilly.com/programming/free/files/modern-java-ee-design-patterns.epub
http://www.oreilly.com/programming/free/files/modern-java-ee-design-patterns.mobi
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
#READ SERVER SIDE EVENTS | |
# I'll properly functionify this later | |
$Url = 'https://api.pipedream.com/sources/MyIDHere/sse' | |
$token = 'token' | |
$request = [System.Net.WebRequest]::CreateHttp($Url) | |
$request.Headers.Add("Authorization", "Bearer $token") | |
$request.AllowReadStreamBuffering = $false | |
$response = $request.GetResponse() | |
$stream = $response.GetResponseStream() |
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-DatePicker | |
{ | |
[CmdletBinding()] | |
[OutputType([System.DateTime])] | |
Param([string]$windowTitle=$null) | |
Add-type -AssemblyName "System.windows.forms" | |
$winForm = New-object Windows.Forms.Form | |
if([string]::IsNullOrEmpty($windowTitle)){ | |
$winForm.Text = "DatePicker Control" |
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
# Form details | |
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") | |
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | |
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Wind") | |
$Form = New-Object System.Windows.Forms.Form | |
$Form.Size = New-Object System.Drawing.Size(600,400) | |
# Start functions |
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
# Name: Ping-Machines | |
# This is a script created for educational purposes, no puppies were harmed while using write-host | |
# The purpose of this script is to be improved with new features, style and best practices | |
# https://www.youtube.com/playlist?list=PL-CiBNPRVIA2KhV94GXuIv2_nQGvyrkJs | |
Write-Host "Script is running" -ForegroundColor Cyan -BackgroundColor Black | |
$Hosts = Get-Content 'C:\temp\MyScript\Hosts.txt' # Source list of devices to ping | |
$Output = 'C:\temp\MyScript\PingResults.txt' # Results output file location |