Skip to content

Instantly share code, notes, and snippets.

View acast15's full-sized avatar

Arman Castillote acast15

View GitHub Profile
@acast15
acast15 / Import Test.csv
Created December 4, 2020 01:35
Import2 Wizard Test CSV
Name Description List Members Due Date Completed Is Paid Task Member Paid Link
Forest and domain configuration Documentation on how to manage Forest and Domain configuration For Review Zak Mason Oct 23, 2020 02:00 PM Yes Yes Yes https://ImportTest.com/Domain-Configuration
Password and audit policies Article explaining Password and Audit Policies For Review Kyle Ellis Oct 08, 2020 02:00 PM No Yes No https://ImportTest.com/Password-And-Audit-Policies
Create a change log for each server Ways how to Create a change log for servers In Progress Toby Johnson Nov 08, 2020 02:00 PM No Yes No https://ImportTest.com/Change-Log-For-Servers
Group Policy Objects (GPOs) How to modify GPOs For Review Trent Hampton; Jeffery Rush Oct 29, 2020 02:00 PM Yes Yes Yes https://ImportTest.com/GPOs
Create a network topology diagram All about creating network topology diagram To Do No Yes No https://ImportTest.com/Network-Topology-Diagram
# Get-LatestAppLog.ps1
## Define the log file
$logDir = 'c:\temp'
$logFile = "$logDir\AppLog_$(Get-Date -format 'yyyy-mm-dd_hh-mm-ss-tt').xml"
## Get the ten latest application log events and export as an xml file
Get-WinEvent -LogName application -MaxEvents 10 |
Export-CliXml $logFile -Force
@acast15
acast15 / AppLogsComplete.ps1
Created February 8, 2021 12:59
Running External PS1
## Displays a Message Box
[System.Windows.Forms.Messagebox]::Show('Checking App Log Files Complete.','App Logs','OK','Information')
@{
Root = ''
OutputPath = ''
Package = @{
Enabled = $true
Obfuscate = $false
HideConsoleWindow = $true
DotNetVersion = 'v4.6.2'
FileVersion = '1.0.0'
FileDescription = ''
@acast15
acast15 / AppLogsComplete.ps1
Created February 12, 2021 12:02
For ISE Steroids
## Displays a Message Box
Add-Type -AssemblyName PresentationFramework
[System.Windows.MessageBox]::Show('Checking App Log Files Complete','App Logs','OK','Information')
@acast15
acast15 / get_unallocated.ps1
Last active April 26, 2021 05:28
Get Unallocated Space
$disks = Get-WmiObject win32_diskdrive ## Gets the list of disks
$partitions = Get-WmiObject win32_diskpartition ## Gets the list of partitions
## Defining Variables
$i = 0
$partitionCount = 0
$myTable = $null
## Scanning Disks and Partitions and their Sizes
foreach($disk in $disks) {
@acast15
acast15 / profile.ps1
Last active March 13, 2022 08:48
Add this function to your PowerShell profile so you won't see the full path of the working directory on the prompt. Once you've configured your profile, restart PowerShell and try any of the options for the prompt.
function demo {
param (
[parameter()]
[ValidateSet('v', 'n', 'r')]
[string]$Option = 'v'
)
switch ($Option) {
# hide PS version
'n' {
function global:prompt { "PS > " }
@acast15
acast15 / AppLogsComplete.ps1
Last active August 1, 2022 12:05
Get-LatestAppLog (dot-sourcing)
## Displays a Message Box
Add-Type -AssemblyName PresentationFramework
[System.Windows.MessageBox]::Show('Checking App Log Files Complete','App Logs','OK','Information')
@acast15
acast15 / TrustCertificate.ps1
Last active November 19, 2023 02:23
PowerShell function to trust a certificate
function Trust-Certificate {
# Prompt the user to input the certificate's path
$certPath = Read-Host "Enter path to certificate"
# Create a new X.509 certificate object
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
try {
# Import the certificate from the specified path
$cert.Import($certPath)