Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

Questions tagged [powershell]

Windows PowerShell is a command line shell and scripting language for Windows that supersedes the CMD.exe shell and batch language. PowerShell is also an automation engine for Windows that provides functionality similar to Windows Script Host and VBScript.

0
votes
0answers
5 views

WQL Query to get all devices connected to a specific hub

What is the WMI / WQL Query syntax to get all devices connected to a specific USB Hub? I can open up a PS terminal and enumerate all USB Hub Devices, as such: gwmi Win32_UsbHub | fl * The output ...
1
vote
0answers
16 views

Disable controls while playing video

I have a couple of folders containing videos, I've created an m3u playlist file in order to play videos consecutively using Powershell, I would like to start playing the file without giving the user ...
0
votes
0answers
18 views

Change taskbar location with powershell and autohide Windows 10 build 14393

I'm trying to place the taskbar location to the top with powershell and let it auto-hide. I found this website with option three what works for most people. The only problem is I'm trying to get ...
0
votes
1answer
22 views

Windows powershell ISE run a bat file in new tab

I am using Powershell ISE to leverage multiple tabbed interface to avoid having too many command prompt windows. Now some of my batch scripts open up anew command line prompt. Is there a way to open ...
0
votes
0answers
25 views

Powershell command to get NAS drive details

I am trying to fetch NAS drive using net use command. I can see the values displaying however not able to get the values using select or any other command. is there any alternative solution? Status ...
1
vote
1answer
29 views

In powershell when I call Get-ChildItem or gci, the Mode column forces each item into 2 lines

A typical result might look something like this: Mode LastWriteTime Length Name ---- ------------- ------ ---- d---- 8/16/2018 11:07 AM <DIR> .vscode ...
0
votes
1answer
21 views

Reliable way to open a group of URLs using Google Chrome on Windows 10 from the command line (batch or powershell)

My code snippet (Windows 10 cmd shell) set s1="https://www.bbc.co.uk/radio4/programmes/schedules#on-now" set s2="https://www.bbc.co.uk/radio4extra/programmes/schedules#on-now" set s3="https://www....
0
votes
1answer
19 views

How to target an event by contained string?

In powershell script i have line: $LogOnEvents = Get-EventLog -Logname security -Message '*name*адрес:*.*.*.*' -Newest 1 This line every time picking wrong one for me. Problem with event triggering. ...
-1
votes
2answers
101 views

How do I get all of the VersionInfo strings from a .exe file from the Windows command prompt

Before Windows 10, one could get all of the VersionInfo strings by right clicking on a file and doing properties. That doesn't work anymore. It's like somebody only decided to show the ones that ...
0
votes
1answer
26 views

Batch Export of images from MS Word Documents

I have over 900 MS Word files that I need to export the images from. I have exported a few files to HTML, but that is a slow/long process for 900+ files. I found a Powershell script on here from a ...
0
votes
3answers
63 views

How to concatenate two values supplied with two keys in different HashTables?

I am trying to concatenate two values provided with two keys in distinct HashTables. Code $caminho = @{ Aplicacao = "C:\Users\marconi.barroso\Desktop\APP"; jdk = "C:\Program Files\java\jdk1....
0
votes
0answers
19 views

PowerShell - Adjust per-app audio output

With the Windows 10 April Update 1803 the long overdue "App volume and device preferences" have been introduced. However, I'm facing an issue where some (mainly older) applications have the correct (...
0
votes
1answer
29 views

Using external parameters in ScriptBlock when sending mail message in PowerShell script

Trying to send mail in the background, using start-job, but having a problem with passing parameters to the scriptblock. Mail params define: $mailParams=@{ To = $AddressTo From = $...
0
votes
1answer
41 views

Set zoom for built in display?

Is there a way to set the zoom for the internal display? I know if I were to use powershell to input: $Host.PrivateData.Zoom = 150 it would zoom just the powershell window to 150%. I need "...
0
votes
0answers
16 views

Win 10 touch pad settings can be changed by the end users with out admin rights [on hold]

We are planning to migrate OS deployment part. So here my requirement is It is possible WINDOWS 10 touch pad settings can be change by the end users with out admin rights. Please suggest me is there ...
0
votes
2answers
27 views

Powershell: Characters in file path as index instead of file path as index?

I am attempting to write a Powershell script to do an incremental differential backup of my computer, however I am having issues with how Powershell is interpreting file path variables. $...
0
votes
2answers
30 views

powershell winforms context menu

Have the following from How to add options to mouse-right-click menu in PowerShell forms $contextMenuStrip1.Items.Add("Item 1") | Out-Null $contextMenuStrip1.Items.Add("Item 2") | Out-Null And it is ...
1
vote
1answer
34 views

Prevent incorrect moving and spam foldering if filetext contain too values

I use this long list in text .txt file to move files into YEAR folders https://pastebin.com/raw/aRP94peb I have this files (examples) in folder that I want to move Caccia a Ottobre Rosso.torrent ...
0
votes
1answer
85 views

Elelevated local admin Runas (or Start-Process -verb Runas) within profile of other user domain user. Is it possible?

I log in as domain user and i want in powershell (or in simple console, no matter) to run a program. the program clean user appdata unnecessary files so it has to operate within user profile. I can do ...
0
votes
0answers
18 views

How do you check the integrity of a VHD without using Powershell or Hyper-V Manager?

I'm running Windows 10 Home, so I cannot enable Hyper-V manager nor use Powershell cmdlets like test-vhd. I used Paragon Hard Disk Manager 16 to create a backup image of my HD in .vhd format, and I'd ...
1
vote
2answers
43 views

How to show event logs containing specific text from powershell

I'm trying to quickly show all events from the last ~day in window's event log which contain a certain string in power shell. I've found powershell commands for listing events, but I basically want ...
0
votes
3answers
51 views

How to check an alias for a cmdlet?

I'm trying to check an alias for a cmdlet. How could I verify this through a command? I have been trying this way: Get-Command -CommandType alias | Where-Object {$ _. Name-like "Copy-Item"} Result:
0
votes
1answer
64 views

Exporting keys in .reg file using Powershell

I need to change several key values in Windows 7 registry, to add a parameter to a command launching VLC. Fortunately all keys are children of keys starting with VLC.: The command for Open and ...
0
votes
1answer
32 views

Powershell command to backup all files except those which are unmodified in git source control

I have a work folder with many GIT and SVN repositories. Since the committed revisions are all available in the server, I just need to backup the unversioned files (modified but not committed, not ...
0
votes
0answers
69 views

Is it possible to get DevCon without downloading it as it installs?

I'm attempting to enable/disable a bunch of things like microphone/camera/wifi etc. Currently using ansible and powershell. Some of it would be a lot easier if I had devcon to work with. ...
0
votes
1answer
68 views

Cleaning up File-share server

I've been trying to make a PowerShell script that lists all files and folders, their created date and last accessed date, size in MB, and if possible the last person that accessed it, with an export ...
1
vote
1answer
39 views

Invoke/execute command with an unknown number of parameters, in PowerShell

Want to execute Invoke-Expression with parameters which can vary depending on the input Having a problem with $MyArgs logic. It should contain only entered parameters Input (example): ./foo.ps1 -...
0
votes
1answer
44 views

windows Powershell console window is not accessible

i see my powershell window is not accessible after a certain point of time, i can see console running and available in taskmanager and taskbar, but when i click powershell console it will not launch ...
0
votes
0answers
15 views

powershell command not executing in docker but does manually

I have a powershell command for my docker image RUN powershell .\Q\Q5.5.2.0\QAS-Setup-64-5_5_2_1.exe /s /v"/L*vx c:\logging.txt" /v"/qn" The docker image successfully builds. However, when I run it ...
0
votes
1answer
47 views

Removing calendar events created by delegate user in Exchange 2010

In Exchange 2010, is it possible to remove calendar events created by a specific delegate user? I don't want to remove events that were actually created by the mailbox owner.
0
votes
1answer
49 views

Script for deduplicating files and folders with a particular suffix

A botched OneDrive restoration has left me with many files and folders with a " (1)" or " (2)" suffix. I would like a script (Bash is fine as I have MinGW + Cygwin, or PowerShell) that would parse ...
1
vote
1answer
71 views

Trying to export single column's data from large CSV file

Problem: I am trying to export a single column of a .CSV file that is 7 gigs in size (large enough that I can't open the entire file in excel... or most text editors for that matter) to a smaller file ...
1
vote
1answer
38 views

Frozen Powershell form when executing SSH commands

Have a simple script that runs via Powershell form By request, it getting information form Linux servers, using plink command, and then prints it as an output in the form. The problem that the form ...
0
votes
0answers
47 views

Adding persistent route through PowerShell not working for Windows 10 Pro VPN client

I'm setting up a new VPN server using L2TP and I'm hitting my last snag. I'm now able to connect to the L2TP VPN using the native Windows 10 Pro client. I do not want to use the remote gateway for ...
0
votes
1answer
6 views

Install-Module returns errors and does not contain -Scope, -Name or other parameters

When I try to use Install-Module to install PowerShell modules, it has two issues: it can't install from https://www.powershellgallery.com as their instructions imply (the error is Module ... was not ...
1
vote
1answer
55 views

export Windows 10 task manager APP history to the txt file

The new windows 10 feature - app history is amazing but i can't get the details in text format, may be it can be done with powershell or other way?
-1
votes
1answer
35 views

Powershell variables in the command

I have this powershell command: $socket = new-object System.Net.Sockets.TcpClient("10.1.2.3", "80") This works great. I would like to be able to enter the ip address & port number at the ...
0
votes
1answer
22 views

Microsoft cloud Active directory run reports

I'm working with cleaning up in our Active driectory after we have moved over to Microsoft cloud in our company. My job is to go through the all the groups in our Store ou on the Active directory ...
0
votes
0answers
36 views

Upgrade Powershell with Powershell

I am wanting to upgrade Powershell on all the client computers within my organization to version 5 ideally, but at least to version 3. Is it possible to run a cmdlet or script in Powershell to upgrade ...
0
votes
1answer
24 views

Powershell launching in Constrained Mode after applying then removing AppLocker/SRP GPOs

Here is the technet post related to this. I will transfer what I've asked and tried to this post, but I am including it for reference. Environment is: 2012 Domain Controller, Win 10 Endpoints, ...
0
votes
1answer
63 views

Is it possible to shut off the microphone and camera via regedit?

I'm attempting to shut down the microphone and camera on Windows 10. I'm trying to automate this process after loading the OS. I attempt to use Disable-PnpDevice in powershell but that does nothing. ...
1
vote
0answers
22 views

script to enable ICS service

I try to build script to select private network and enable part of ICS services. I select the private network with these code: { # Constants $public = 0 $private = 1 Write-Host "Creating netshare ...
0
votes
1answer
22 views

Unable to Publish PowerShell Module to Local Repo that is Dependent on an Externally Managed Module

I've written and compiled a PowerShell module that is essentially a glorified wrapper of the ActiveDirectory module. My module has a proper Module Manifest file as well. I've also created a ...
1
vote
1answer
33 views

Cannot type in cmd- or Powershell-window when run from Powershell as different user in Windows 10

When I execute the following code: $creds = Get-Credential -UserName other -Message none # answering the creds dialogue with correct password here Start-Process C:\Windows\system32\cmd.exe -...
0
votes
1answer
18 views

How could I set a description for all users at the same OU?

I'm trying to use the output from write-output command and use Set-ADUser to change Descripton field from all Users on a specific OU. First I did: Import-Module ActiveDirectory $Users = Get-ADUser -...
0
votes
2answers
63 views

Deleting files using wildcards

I have hundreds of files named like SageAccts Company Name 2018-06-21 00-00-10. The time and date are in the title. I wish to delete all files that do not have a date of 2018-**-05, 2018-**-15 or ...
1
vote
1answer
27 views

Server 2016: Use DNS Policies to Allow Queries to Specific Domain from Specific Subnet

On a public DNS server, I would like to create a rule using DNS Policies to allow traffic to a specific domain only from specified subnets. For example, say we have a domain contoso.com, but only ...
0
votes
0answers
55 views

Using timeout and hibernate together for windows 10

So, I'm in love with the Windows power savings feature set. If my power bill drops any lower, the utility company will be paying me! That said, I still have a bad habit of staying up late, so I want ...
0
votes
1answer
126 views

Remove all Default Apps Except few Using Powershell - Error: Deployment failed with HRESULT: 0x80073CFA

I used the script from Windows 10: Remove all default apps except specified ones. Get-AppxPackage -AllUsers | where-object {$_.name –notlike "*store*","*windowscalculator*","*people*"} | Remove-...
0
votes
1answer
61 views

PowerShell Scripts in Windows Unattend Answer File XML

So I have a Windows 10 Unattend Answer File. I got the parts where it skips the OOBE screens, enables admin account, and copy profile. I am trying to set the answer file to run a PowerShell script to ...