powershell

From command line download latest Java SE Runtime Environment 8 on Windows

半腔热情 提交于 2021-02-16 19:53:14
问题 On a Windows server, I am looking for a robust way to download latest Java SE Runtimes from command-line . My requirement is to check if java is installed on the system. If java is not found, our MSI installer (created with WIX) need to connect oracle java download page and silently download java installer in the background and invoke the installer silently. Download option can be in VB script/PowerShell/batch/Java Installing java silently is easy with jre-8u121-windows-x64.exe /s option. I

Powershell: delete all the registry keys containing a string

瘦欲@ 提交于 2021-02-16 18:08:53
问题 I would like to delete all the keys ( 1000+ ) containing Python35 from : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-2\Components For instance I would like to delete all the keys similar to that one: Keyname: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-2\Components\0027CAECCC428F356B8D845FF8331246 Name: 0F617A7B1C879BC47865E0155CDD6722 Data: C:\Users\Me\AppData\Local\Programs\Python\Python35\Lib\venv\__init__

Powershell: delete all the registry keys containing a string

狂风中的少年 提交于 2021-02-16 18:06:54
问题 I would like to delete all the keys ( 1000+ ) containing Python35 from : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-2\Components For instance I would like to delete all the keys similar to that one: Keyname: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-2\Components\0027CAECCC428F356B8D845FF8331246 Name: 0F617A7B1C879BC47865E0155CDD6722 Data: C:\Users\Me\AppData\Local\Programs\Python\Python35\Lib\venv\__init__

Powershell: delete all the registry keys containing a string

可紊 提交于 2021-02-16 18:06:20
问题 I would like to delete all the keys ( 1000+ ) containing Python35 from : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-2\Components For instance I would like to delete all the keys similar to that one: Keyname: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-2\Components\0027CAECCC428F356B8D845FF8331246 Name: 0F617A7B1C879BC47865E0155CDD6722 Data: C:\Users\Me\AppData\Local\Programs\Python\Python35\Lib\venv\__init__

Powershell: Get-ADComputer from another domain returns OperatingSystem information blank/missing

旧街凉风 提交于 2021-02-16 17:54:05
问题 Trying to list all computers with their OS information that belong to another trusted domain, but OperatingSystem and OperatingSystemVersion returns blank values: Get-ADComputer -Filter * -Properties Name, OperatingSystem, OperatingSystemVersion -SearchBase "" -Server OtherDomain.com.au:3268 | Format-Table Name, OperatingSystem, OperatingSystemVersion Only the Name property is populated. If I run this, it returns alot of info, but the OS info is all blank: Get-ADComputer -Filter * -Properties

Add-Migration command only prompt “ScriptHalted”

巧了我就是萌 提交于 2021-02-16 16:31:27
问题 I'm trying to learn how to make App.Net Core application using Razor pages, using this tutorial : https://docs.microsoft.com/en-us/aspnet/core/tutorials/razor-pages/model?view=aspnetcore-3.0&tabs=visual-studio After I made the Movie model and scaffold it successfully, I try to make the initial migration of the database. However, every time I'm using the command Add-Migration , it just prompts ScriptHalted , even when using the verbose option, same with Update-Database . I tried other commands

Is there a way to add the Developer Powershell for VS 2019 as an integrated terminal in VSCode?

冷暖自知 提交于 2021-02-16 15:09:51
问题 I'm working on a project that requires me to compile C++ code using MSVC, but I am working mostly with VSCode. As such, I was wondering if there is a way for me to add the Developer Powershell as an integrated terminal, so that I can compile without needing a secondary terminal open. I thought of just opening VSCode from the Developer PS itself, but since this is mostly a temporary project it seemed like a lot of repetitive work. I tried using the Shell launcher extension for VSCode but it

Is there a way to add the Developer Powershell for VS 2019 as an integrated terminal in VSCode?

怎甘沉沦 提交于 2021-02-16 15:09:00
问题 I'm working on a project that requires me to compile C++ code using MSVC, but I am working mostly with VSCode. As such, I was wondering if there is a way for me to add the Developer Powershell as an integrated terminal, so that I can compile without needing a secondary terminal open. I thought of just opening VSCode from the Developer PS itself, but since this is mostly a temporary project it seemed like a lot of repetitive work. I tried using the Shell launcher extension for VSCode but it

RegEx to match string between two strings in Powershell

吃可爱长大的小学妹 提交于 2021-02-16 15:02:07
问题 Here is my sample data: Option failonnomatch on Option batch on Option confirm Off open sftp://username:password@host.name.net:22 hostkey="ssh-rsa 1024 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00" get File*.txt \local\path\Client\File.txt mv File*.txt /remote/archive/ close exit I would like to create a powershell script to extract pieces of information out of this text file. List of items I need: Username Password Host Port ssh key File Name Local Path Remote Path I'm hoping that if I

I need to extract Data from a single line of json-data which is inbetween two variables (Powershell)

大城市里の小女人 提交于 2021-02-16 14:49:27
问题 I need to extract Data from a single line of json-data which is inbetween two variables (Powershell) my Variables: in front of Data: DeviceAddresses":[{"Id": after Data: ," I tried this, but there needs to be some error because of all the special characters I'm using: $devicepattern = {DeviceAddresses":[{"Id":{.*?},"} #$deviceid = [regex]::match($changeduserdata, $devicepattern).Groups[1].Value #$deviceid 回答1: As you've found, some character literals can't be used as-is in a regex pattern