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
$files= Get-childitem Y: | select -last 90 | |
function Process-RADIUSLogs () { | |
[CmdletBinding()] | |
param( | |
$file, | |
[switch]$onlyAccepted | |
) | |
Write-Verbose "Processing $file" | |
$data = get-Content $file |
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
$exampleData = [PsCustomObject]@{ | |
SimpleField1 = "user" | |
ComplexField2 = @{ | |
Property1 = "value1" | |
Property2 = "value2" | |
} | |
} | |
<# |
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
#credits | |
#https://stackoverflow.com/questions/7330187/how-to-find-the-windows-version-from-the-powershell-command-line | |
#https://serverfault.com/questions/1035099/getting-full-windows-version-on-batch-or-powershell-like-microsoft-windows-v | |
function Check-WUAV { | |
param($servers) | |
BEGIN{ | |
$scriptblock = { |
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
#Parameters | |
$SiteURL = "https://company.sharepoint.com" | |
Connect-PnPOnline $SiteURL -UseWebLogin | |
$FolderSiteRelativeURL = "/Shared Documents/EC/Projects" | |
$downloadPath = "C:\temp" | |
Function Get-SPOFolderStats | |
{ |
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
$SiteURL = "https://company.sharepoint.com" | |
Connect-PnPOnline $SiteURL -UseWebLogin | |
$FolderSiteRelativeURL = "/Shared Documents/path/path" | |
$downloadPath = "C:\temp" | |
$folder = Get-PnpFolder $FolderSiteRelativeURL | |
Get-PnPProperty -ClientObject $Folder -Property ServerRelativeUrl, Folders | Out-Null | |
$Web = Get-PnPWeb -Includes ServerRelativeUrl | |
$SiteRelativeUrl = $Folder.ServerRelativeUrl -replace "$($web.ServerRelativeUrl)", [string]::Empty | |
#show items |
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
$guid = New-Guid | |
$webdata = Invoke-RestMethod -Uri "https://endpoints.office.com/endpoints/worldwide?clientrequestid=$guid" | |
<# webdata example | |
id : 65 | |
serviceArea : Common | |
serviceAreaDisplayName : Microsoft 365 Common and Office Online | |
urls : {account.office.net} | |
ips : {52.108.0.0/14, 2603:1006:1400::/40, 2603:1016:2400::/40, 2603:1026:2400::/40...} | |
tcpPorts : 80,443 |
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
# FileAging.ps1 | |
# This script developed and tested with PowerShell RTM | |
Param($dir) | |
if ($dir -isnot [string]) { | |
Write-Host “ERROR: You must specify a directory path!” ` | |
-foregroundcolor “RED” -backgroundcolor “Black”;` | |
return | |
} |
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 ConvertToMp3( $file, [string] $vlc = 'C:\Program Files\VideoLAN\VLC\vlc.exe') { | |
PROCESS { | |
$codec = 'mp3'; | |
$oldFile = Get-Item $file; | |
$newFile = $oldFile.FullName.Replace($oldFile.Extension, ".$codec"); | |
&"$vlc" -I dummy "$oldFile" ":sout=#transcode{acodec=$codec,vcodec=dummy}:standard{access=file,mux=raw,dst=$newFile}" vlc://quit | out-null; | |
#Only remove source files when you are sure that the conversion works as you want |
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 AddItemProperties($item, $properties, $output) | |
{ | |
if($item -ne $null) | |
{ | |
foreach($property in $properties) | |
{ | |
$propertyHash =$property -as [hashtable] | |
if($propertyHash -ne $null) | |
{ | |
$hashName=$propertyHash[“name”] -as [string] |
OlderNewer