Bootstrap
<FreeKB>
Home
About
Walkthroughs
PowerShell
Profile
Sign in
FreeKB Articles
PowerShell articles
base64
Base64 encoding and decoding
Batch Files
Start a PowerShell script from a batch file
Break
Break out of a loop or block
command line options and flags
Getting Started with command line options and flags
Count
Get-ChildItem Count command
Date Time
Date and Time using Get-Date
Dictionaries
Getting Started with Dictionaries
Event Viewer
Export event viewer to a log file
Files and Directories
Append to a file using Add-Content
Copy file using Copy-Item
Create file using New-Item or Set-Content
Delete files and directories using using Remove-Item
Determine if file or directory exists using Test-Path
Display file or directory permissions using the Get-Acl cmdlet
Get file base name and directory name
List files and directories using Get-ChildItem
Read file using Get-Content
Rename file or directory using Rename-Item
Unzip files using Expand-Archive
Upload or Download files between remote servers using Copy-Item and PSSession
Filter
Filter results using Select-String
FTP
Connect to an FTP Server
Connect to an FTPS Server
Connect to an SFTP Server
List files on an FTP server
Upload, download, and delete files from an FTP server
Functions
Getting Started with functions
Hostname
System hostname using the $env:computername variable
if elseif else statements
if elseif else statements
Install
Download and install a file
ISO
Bootable USB ISO
Lists
Getting Started with Lists
Map a Network Drive
Map a Network Drive using New-PSDrive
Remote Connection
Configure PowerShell for Remote Connections
Connect to a remote server using New-PSSession
Disconnect from a remote server using Remove-PSSession
Run Commands on Remote Server using Invoke-Command
Replace
Replace string
Run EXE
Run an executable or bat script
Scheduling
Run a PowerShell script on a schedule using FBTaskScheduler
Script Root
Return script root using $PSScriptRoot
Services
Restart a service using Restart-Service
Spliting string
Split fields at delimiter
SQL statements
SQL statements
Troubleshooting
Resolve "the source and destination paths did not resolve to the same provider"
Resolve "Cannot be loaded because the execution of scripts is disabled on this system"
Resolve "the specified server cannot perform the requested operation"
Resolve "The WinRM client cannot complete the operation within the time specified"
try catch
try catch finally block
Users and Groups
Add a user to the administrators group using the adsi command
Version
Display PowerShell version