Skip to content

Instantly share code, notes, and snippets.

:octocat:
Learning

François-Xavier Cat lazywinadmin

:octocat:
Learning
Block or report user

Report or block lazywinadmin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View PSGalleryStats.ps1
# Option 1
invoke-restmethod -method Get -URI "https://www.powershellgallery.com/api/v2/Search()?`$filter=(startswith(Id,'PSClass') and IsLatestVersion) or (startswith(Id,'Adsi') and IsLatestVersion)"|
select -expand properties|select -expand downloadcount
# Option 2
$a = find-module az
$a.AdditionalMetadata.Downloadcount # total download
$a.AdditionalMetadata.versionDownloadCount # download for current version
@lazywinadmin
lazywinadmin / meetup-events.ps1
Created Mar 26, 2019
Get the list of event for a Meetup.Com User Group
View meetup-events.ps1
Import-Module MeetupPS
Get-MeetupEvent -GroupName FrenchPSUG -status past |
Select Name,local_date,link, yes_rsvp_count |
Export-csv "Meetup.com-FRPSUG$(Get-Date -format yyyyMMdd).csv" -notype -enco UTF8
@lazywinadmin
lazywinadmin / ExportMVPAllcontrib.ps1
Created Mar 25, 2019
Export MVP Contributions in CSV
View ExportMVPAllcontrib.ps1
#https://lazywinadmin.com/2018/01/MVPModule-BackupMyEntries.html#backup-per-year
# Connect to api
$Key = '<Your Secret key>'
Set-MVPConfiguration -SubscriptionKey $Key
# Get All contributions
$AllContrib = Get-MVPContribution -limit 1000
# Retrieve important data and select the useful properties that
# we can use for the next import
@lazywinadmin
lazywinadmin / psgallerystats.ps1
Created Mar 22, 2019
Parse PowerShell Gallery (PSGallery) stats in PowerShell Core
View psgallerystats.ps1
((iwr https://www.powershellgallery.com/stats/packages).content -split '\r\n' |sls -Pattern '<a href="/packages/' -Context 0,1)|%{[pscustomobject]@{'Package'=$_.line -replace '<td><a href="/packages/.+/">|</a></td>|\s+';"Stats"=([string]($_.context.postcontext) -replace '\s+|<td><a href="/stats/packages/.+?groupby=Version">|</a></td>')-as [int];"Link"=-join("https://www.powershellgallery.com",$_.line -replace '<td><a href="|/">.+</a></td>|\s+')}}|select -first 100
<#
Package Stats Link
------- ----- ----
SpeculationControl 20195596 https://www.powershellgallery.com/packages/SpeculationControl
AzureRM.profile 2205020 https://www.powershellgallery.com/packages/AzureRM.profile
Carbon 1507538 https://www.powershellgallery.com/packages/Carbon
AzureRM.KeyVault 1398051 https://www.powershellgallery.com/packages/AzureRM.KeyVault
@lazywinadmin
lazywinadmin / Youtube-Rss-Frpsug.ps1
Created Feb 15, 2019
Retrieve the last videos of a Youtube channel
View Youtube-Rss-Frpsug.ps1
irm https://www.youtube.com/feeds/videos.xml?channel_id=UCyxicOKZNm_u1opF_xAYfDA
@lazywinadmin
lazywinadmin / WinPENanoDomainJoin.ps1
Created Jan 9, 2019 — forked from dotps1/WinPENanoDomainJoin.ps1
Nano domain join for use in SCCM task sequence!
View WinPENanoDomainJoin.ps1
$source = @'
using System;
using System.Security.Principal;
using System.Runtime.InteropServices;
namespace ECGCAT
{
public class Kernel32
{
[DllImport("Kernel32.dll", SetLastError = true)]
@lazywinadmin
lazywinadmin / WinPENanoDomainJoin.ps1
Created Jan 9, 2019 — forked from Ryan2065/WinPENanoDomainJoin.ps1
Nano domain join for use in SCCM task sequence!
View WinPENanoDomainJoin.ps1
$source = @'
using System;
using System.Security.Principal;
using System.Runtime.InteropServices;
namespace ECGCAT
{
public class Kernel32
{
[DllImport("Kernel32.dll", SetLastError = true)]
@lazywinadmin
lazywinadmin / FrPSUG-Parse_survey_sondage.ps1
Last active Oct 28, 2018
French PowerShell User Group - Parse the survey on topics from 2017/09 sent to all members
View FrPSUG-Parse_survey_sondage.ps1
# Load file
$Content = import-csv 'responses.csv' -Header time,VotreNiveau,HeureParfaite,NiveauDesPresentations,Sujet |
select -Skip 1 |
select -prop VotreNiveau,HeureParfaite,NiveauDesPresentations,Sujet
# Create some arrays
$allHeureParfaitevalues=@()
$allSujetvalues=@()
# Retrieve properties (questions) and foreach...
@lazywinadmin
lazywinadmin / Powershell_HTTP_Server.MD
Created Aug 4, 2018 — forked from jakobii/HTTPServer.ps1
A Basic Powershell Webserver
View Powershell_HTTP_Server.MD

This is a super SIMPLE example of how to create a very basic powershell webserver

# Http Server
$http = [System.Net.HttpListener]::new() 

# Hostname and port to listen on
$http.Prefixes.Add("http://localhost:8080/")
View Input_from_pipeline_or_parameters.ps1
#https://communary.net/2015/01/12/quick-tip-determine-if-input-comes-from-the-pipeline-or-not/
function Invoke-Test {
[CmdletBinding()]
param (
[Parameter(ValueFromPipeline)]
[PSObject[]] $InputObject,
[Parameter()]
[string] $SecondParam
)
You can’t perform that action at this time.