Questions tagged [powershell-4.0]

37 questions
360
votes
12 answers

Native alternative to wget in Windows PowerShell?

I know I can download and install the aformentioned library (wget for Windows), but my question is this: In Windows PowerShell, is there a native alternative to wget? I need wget simply to retrieve a file from a given URL with HTTP GET. For…
26
votes
2 answers

Why does running PowerShell change my console font?

I have a strange problem on my laptop - when I run Powershell within an existing console window, the font choice for the window changes. For example, this is cmd.exe immediately after opening the window: The fonts, window size and colours used are…
Bevan
  • 2,913
10
votes
9 answers

Test network ports faster with PowerShell

In Windows 8.1, the Test-NetConnection cmdlet is useful for checking the state of a network port on a remote system. However, it can be unnecessarily slow sometimes. I'd like to know if there's some options I could tweak, or an alternative…
Iszi
  • 14,163
6
votes
2 answers

Can the default PowerShell terminal keep a command history?

Is there a way to have PowerShell remember commands entered during the previous sessions? That is, after closing the window and opening it again, can PowerShell be setup to remember the commands?
Louis Waweru
  • 25,409
  • 45
  • 137
  • 203
5
votes
5 answers

Get-ChildItem | tree gives me a wierdly formatted tree

The following input: PS STG:\> Get-ChildItem | tree Gives me Folder PATH listing for volume Data Volume serial number is 6576-C540 D:. ÃÄÄÄAPK ÃÄÄÄAssets ³ ÃÄÄÄAnimations ³ ³ ÃÄÄÄCharacters ³ ³ ³ ÀÄÄÄinhabitant ³ ³ …
4
votes
1 answer

Don't want to display WARNING: ACTIONS REQUIRED: while running powershell script

I have written bitlocker code to backup key after old key has been shared with user. My requirement is that don't want to display WARNING: ACTIONS REQUIRED: while running script $BLV = Get-BitLockerVolume -MountPoint "C:" $KeyProt =…
4
votes
2 answers

Powershell Custom Properties - Change Property name

I have a custom object, and I would like to change the property name of one of the existing properties. Is that possible? I know I could create a new property with the new name, copy the values from the old property and then select only the…
3
votes
3 answers

PowerShell issue - IF statement curly brackets

I’ve come across something with PS and I don’t know if I’m doing something wrong or maybe it is just a bug in PS (and I can’t find the answer anywhere)? I’ve tested this with PS v4, v5.0 and v5.1 using different Windows OS’s. First, it seems that…
SOSidb
  • 533
3
votes
2 answers

stop-computer : Privilege not held

I am running Powershell (v4) on a Windows7 box ; I was able to until yesterday (2017-04-12) to issue a 'stop-computer' command to shutdown my computer. Today: I am unable to do so; I get this response: ('zaphod' is the hostname): PS…
3
votes
0 answers

Unable to kill a process

With admin rights and Powershell, I want to kill a nasty process. PS D:\_prj> Get-Process someapp* | Stop-Process -Force (or without -Force). That works in 99% of cases. Unfortunately, sometimes it don't. After executing the command I check whether…
Leśny Rumcajs
  • 310
  • 3
  • 12
2
votes
2 answers

Using Advanced Parameter Sets in a Function with Multiple Unique Switches

I am using Powershell 4.0. I am attempting to write a cmdlet and in this cmdlet I would like to use Advanced Parameter sets to have certain options available based on what parameter(s) is/are chosen. This particular function will essentially and…
2
votes
1 answer

Invoke-Sqlcmd not working after PowerShell 4 install

I installed PowerShell 4 yesterday and ever since then, I get the error "The term 'Invoke-Sqlcmd' is not recognized as the name of a cmdlet, function". This has been working just fine for months until PowerShell 4. I have SQL 2012 SP1 installed with…
Russ
  • 155
2
votes
1 answer

Powershell script to capture Screenshot

Don't want to use third party tool and module. $ie = New-Object -ComObject InternetExplorer.Application $ie.Visible = $true $ie.Navigate("https://www.google.com") $ie.FullScreen = $true while($ie.busy){ Start-Sleep -Seconds 10 } Add-Type…
2
votes
2 answers

PowerShell select-object Expand Property For multiple values

How can I Filter Files Name and Complete Files Path Using powershell select-object expand property here is files in partition Mode LastWriteTime Length Name ---- ------------- ------ ---- d---- 3/9/2021…
Sadam
  • 144
2
votes
1 answer

How to merge multiple excel files and update the merged file's worksheet names as excel files?

Can somebody please help me to resolve this. This is my requirement: I have few excel files (It will vary) in a folder D:\Script\Test The name of the files are ExcelA, ExcelB, ExcelC etc It has worksheets like this: A1 (for ExcelA), B1(for…
1
2 3