Skip to content

Instantly share code, notes, and snippets.

New-Item -Path $env:SYSTEMDRIVE\ -Name 'PS\List' -ItemType Directory
$FileList = "$env:SYSTEMDRIVE\PS\List\Listinstall.txt"
Get-AppxProvisionedPackage -online | select DisplayName > $FileList; cat $FileList;
get-help Get-AppxProvisionedPackage -examples
<#
###############################################################################
# Эта команда перечисляет пакеты приложений (.appx) в образе Windows,
@numbnet
numbnet / Rename-Computer.ps1
Created May 1, 2021 17:40
Rename Computer
$NEWCOMPUTERNAME = MyPC;
echo "This PC Name - $env:COMPUTERNAME";
if ($env:ComputerName -in $NEWCOMPUTERNAME) {
echo "
This is Computer - $env:COMPUTERNAME
========================================
";
exit
} else {
echo "Rename this Computer?"; pause; Rename-Computer -NewName $NEWCOMPUTERNAME -Force;
##====================================================
## start as ADMIN
$currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())
$testadmin = $currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
if ($testadmin -eq $false) {
Start-Process powershell.exe -Verb RunAs -ArgumentList ('-noprofile -noexit -file "{0}" -elevated' -f ($myinvocation.MyCommand.Definition))
exit $LASTEXITCODE
}
@numbnet
numbnet / VariantsSearch.md
Last active April 11, 2021 18:02
Search Variable

Примеры регулярных выражений ##

Поиск точной фразы Поиск слова или фразы из списка Поиск слова в разных вариантах написания или со специальными символами Поиск любого адреса электронной почты в определенном домене Поиск любого IP-адреса в определенном диапазоне Поиск буквенно-цифровой строки

GitHub Markdown

==================================================

Headers

This is an

tag

This is an

tag

This is an
tag

@numbnet
numbnet / ComputerName.ps1
Last active April 8, 2021 13:14
Net core app
Rename-Computer -NewName NN -Force
Restart-Computer -ComputerName NN -Confirm -Force
##*************************************************
New-Item -Path $env:SYSTEMDRIVE\ -Name 'PS\OpenSSH' -ItemType Directory
##====================================================
### ARH OS and Download OpenSSH x64 or x86
echo "******** Start Download OpenSSH v8.1.0.0p1-Beta .......... *********";
echo " "
if ((Get-WmiObject win32_operatingsystem | select osarchitecture).osarchitecture -like "64*")
{
@numbnet
numbnet / .vsconfig
Last active April 1, 2021 13:15
EXAMPLE
<<<<<<< HEAD
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Component.CoreEditor",
"Microsoft.VisualStudio.Workload.CoreEditor",
"Microsoft.NetCore.Component.Runtime.5.0",
"Microsoft.NetCore.Component.Runtime.3.1",
"Microsoft.NetCore.Component.SDK",
"Microsoft.VisualStudio.Component.NuGet",
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="UTF-8" ?>
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
<!-- You may use this file to transfer that content from one site to another. -->
<!-- This file is not intended to serve as a complete backup of your site. -->
<!-- To import this information into a WordPress site follow these steps: -->
<!-- 1. Log in to that site as an administrator. -->
<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
<!-- 3. Install the "WordPress" importer from the list. -->