Skip to content

Instantly share code, notes, and snippets.

View hansgafriedzal's full-sized avatar

Hans hansgafriedzal

View GitHub Profile
@hansgafriedzal
hansgafriedzal / www.domain.com.ps1
Created June 7, 2020 16:04
open site in msedge as app
$uri = (dir $PSCommandPath).BaseName
start msedge -args "--app=https://$uri"
$containerTo = 'srt'
dir -File | where name -NotLike *.$containerTo | %{
Write-Host
$_.FullName
& cmd /c "ffmpeg -n -i ""$($_.Name)"" -map 0:s:0 ""$($_.BaseName).$containerTo"" 2>&1"
}
$containerFrom = 'flv'
$containerTo = 'mp4'
dir -File -Filter "*.$containerFrom" | %{
$_.FullName
Write-Host
& cmd /c "ffmpeg -i ""$($_.Name)"" -acodec copy -vcodec copy ""$($_.BaseName).$containerTo"" 2>&1"
}
function Verb-LibraryFunctionName {
param
(
)
begin
{
$timestamp = Get-Date -format "yyyyMMddHHmmss"
$executionName = $MyInvocation.MyCommand
@hansgafriedzal
hansgafriedzal / Get-MsolUserLicenceService.ps1
Last active October 7, 2021 09:45
Get MSOL users, their licences, and services
function Get-MsolUserLicenceService {
param
(
[Parameter(ValueFromPipeline = $true)]
[Microsoft.Online.Administration.User] $User
)
PROCESS {
$user | ? { $_.isLicensed -eq $true } | % {
$user = $_
$tenant = (Get-MsolCompanyInformation).DisplayName
$out = @()
Get-MsolAccountSku | %{
$licence = $_
$licence.ServiceStatus | %{
$service = $_
$out += [PSCustomObject] @{
$tenant = (Get-AzureADTenantDetail).DisplayName
$out = @()
Get-AzureADSubscribedSku | %{
$licence = $_
$licence.ServicePlans | %{
$service = $_
$out += [PSCustomObject] @{
function find-duplicates
{
param($nums)
$tortoise = $nums[0]
$hare = $nums[0]
do
{
$tortoise = $nums[$tortoise]
$keywordUpn = "riju"
Get-AzureADUser -Filter "startswith(UserPrincipalName, '$($keywordUpn)')" | %{
$user = $_
Get-AzureADUserMembership -ObjectId $user.ObjectId | %{
$group = $_
[PSCustomObject] @{
UserPrincipalName = $user.UserPrincipalName
GroupDisplayName = $group.DisplayName
cls
function Get-RelativeComplement {
param([PSObject[]]$Of, [PSObject[]]$In )
Compare-Object $In $Of -IncludeEqual -PassThru | ?{
$Of -notcontains $_
}
}