Last active
January 2, 2021 11:40
-
-
Save bytemain/6c89e4ad1ec0a891c7c95fe9fdaeaad1 to your computer and use it in GitHub Desktop.
powershell scripts
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
Get-Process -Id (Get-NetTCPConnection -LocalPort 5000).OwningProcess |
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
$array = Get-ChildItem | Select-Object Name | |
foreach ($element in $array) { | |
$filename = [System.IO.Path]::GetFileNameWithoutExtension($element.Name) | |
Write-Output $filename | |
New-Item -Path C:\Users\withw\AppData\Local\Temp\artin-1i4qojv5 -Name $filename -ItemType Directory | |
} |
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
Get-ChildItem -Recurse | Measure-Object | Select-Object -ExpandProperty Count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment