Skip to content

Instantly share code, notes, and snippets.

Avatar

perXautomatik

View GitHub Profile
@perXautomatik
perXautomatik / Compare-DFStoFolders.ps1
Created Jan 17, 2023 — forked from markwragg/Compare-DFStoFolders.ps1
Powershell script to get a list of DFS folder targets for all DFS folders under a defined path and test if those paths are valid from the location running the script.
View Compare-DFStoFolders.ps1
$Servers = @("SERVER01","SERVER02","SERVER03")
$FolderPaths = $Servers | foreach {
Get-ChildItem "\\$_\DFSShare$"
} | Sort Path
$FolderPaths | Export-Csv "FolderPaths-$(Get-Date -format yyyy-MM-dd).csv" -NoTypeInformation
$TestPaths = (($FolderPaths).FullName | Sort-Object).Trimend('\')
$DFSPaths = ((Import-CSV "DFS-$(Get-Date -format yyyy-MM-dd).csv").TargetPath | Where-Object {($_ -ilike "*SERVER*") | Sort-Object).Trimend('\')
@perXautomatik
perXautomatik / JEWebDav.ps1
Created Jan 15, 2023 — forked from darkquasar/JEWebDav.ps1
Simple WebDav Server in Powershell
View JEWebDav.ps1
<#
Obtained from https://github.com/re4lity/subTee-gits-backups/blob/master/JEWebDav.ps1
#>
<#
.SYNOPSIS
Simple Reverse Shell over HTTP. Deliver the link to the target and wait for connectback.
Read And Write Files Over WebDAV Proof Of Concept
@perXautomatik
perXautomatik / how-to-create-a-filefolder-in-windows-super-user.md
Last active Jan 15, 2023
How to create a FileFolder in Windows? - Super User
View how-to-create-a-filefolder-in-windows-super-user.md

Windows has the ability to create shortcuts. When you do, they appear as shortcuts in the files section of a folder. To create one, you right click, new, shortcut, or copy and paste as shortcut amonst other options.

However, windows also has something called a FileFolder, which is a shortcut that is treated like a folder, rather than a file. So with sorting, it appears in the folders location, it appears in the folderviewpane and from the addressbar.

Now, there's also the symbolic links, which is similar to FileFolders, but one thing a symbolic link cannot do, is be placed on a network share and point to a folder on your local computer that is not shared, and if you open that link from a different computer, it opens on their computer instead, like a normal shortcut would do.

A way to create a FileFolder is to use the Add a network location wizard and link to it.

So far I figured out that the location of this FileFolder is:

@perXautomatik
perXautomatik / how-does-the-windows-file-explorer-quick-access-recent-items-feature-work-super-user.md
Created Jan 15, 2023
How does the Windows File Explorer Quick Access recent items feature work? - Super User
View how-does-the-windows-file-explorer-quick-access-recent-items-feature-work-super-user.md

Quick Access is a virtual folder that presents two JumpLists in a folder view --- Frequentfolders and Recentfiles.

Jumplists are most commonly seen when you right-click on a Taskbar icon. enter image description here

The best overview of their behavior I found is this MS article.

By default, a standard Jump List contains two categories: recent items and pinned items, although because only categories with content are shown in the UI, neither of these categories are shown on first launch. Always present are an application launch icon (to launch more instances of the application), an option to pin or unpin the application from the taskbar, and a Close command for any open windows.

...

@perXautomatik
perXautomatik / shell-links-win32-apps-microsoft-learn.md
Created Jan 15, 2023
Shell Links - Win32 apps | Microsoft Learn
View shell-links-win32-apps-microsoft-learn.md
@perXautomatik
perXautomatik / initial
Created Nov 4, 2022
Powershell Ise ideas
@perXautomatik
perXautomatik / working-with-powershell-variables-c-aspnet-vbnet.md
Created Oct 26, 2022
Working with PowerShell variables - C#, ASP.Net, VB.Net
View working-with-powershell-variables-c-aspnet-vbnet.md

Variable name syntax

Now what about variable names? What characters are allowed in a variable name? The answer is: any character you want, with some caveats. There are two notations for variables. The simple notation starts with a dollar sign followed by a sequence of characters, which can include letters, numbers, the underscore, and the colon. The colon has a special meaning that we'll get to in a minute. The second notation allows you to use any character in a variable name. It looks like this:

${This is a variable name}

You can use any character you want in the braces. You can even use a close brace if you escape it, as we see in the next example.
PS (7) > ${this is a variable name with a `} in it}
PS (8) > ${this is a variable name with a `} in it} = 13

@perXautomatik
perXautomatik / FindFunctionsInScript.ps1
Last active Oct 6, 2022 — forked from Jaykul/Trace-Dependency.ps1
Extract a list of functions names and definitions inside a script, listing line numbers function begin and end;
View FindFunctionsInScript.ps1
[CmdletBinding()]
param(
# The script or file path to parse
[Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)]
[Alias("Path", "PSPath")]
$Script
)
process {
Write-Progress "Parsing $Script"
View CheckMounted.ps1
if ((get-command Get-VM -erroraction silentlycontinue) -ne $null)
{Get-VM *}
$importance = "Failed", "Warning", "Success"
$list = @(
@{ name = "Warning" }
@{ name = "Success" }
@perXautomatik
perXautomatik / Move building.md
Last active Oct 9, 2022
[Oxygen not included] Ai #modding
View Move building.md

deconstruct and reconstruct errand