Intro

Here are some PowerShell notes.

Notes

Execute unsigned script

PowerShell.exe -ExecutionPolicy Bypass -File Script.ps1

Delete a character from files

Example here where we remove o character for all mp4 files

Get-ChildItem -filter *mp4 | Rename-Item -NewName {$_.Name -replace "o"}

Change network connection profile

Get-NetConnectionProfile
Set-NetConnectionProfile -InterfaceIndex 10 -NetworkCategory Private

Set time

Set-Date -date "12/7/2017 4:00 PM"

Change Last Write Time

$a = Get-Item '.\Download\myfile.txt'
$a.LastWriteTime = "10/03/2016 8:00 AM"

A function to send email

Function Mail
 {
        param ([string]$sujet)

        $encoding = [System.Text.Encoding]::UTF8
        Send-MailMessage -To destination@shebangthedolphins.net -Subject $sujet -From source@shebangthedolphins.net -smtpserver smtp.shebangthedolphins.net -Body $sujet -Encoding $encoding
 }

Mail "Subject"
Licence Creative Commons
This websitehttp://shebangthedolphins.net is licensed to the public under a licence Creative Commons Attribution licence.
Contact :