Questions tagged [powershell-ise]

PowerShell-ISE refers to Microsoft Windows PowerShell's Integrated Scripting Environment.

PowerShell-ISE refers to Windows PowerShell's Integrated Scripting Environment. The ISE offers the features of the PowerShell console plus script editing and debugging features. ISE is also unicode aware, vs the Console that isn't!

522 questions
0
votes
3 answers

Powershell word wrapping at 59 characters

Using this command result is divided on two lines, first trimmed on 59 characters, second - all other characters $command ='nuget.exe list "Json.NET" -source "https://www.nuget.org/api/v2/"' (Invoke-Expression "$command") | out-file C:\test.txt It…
Sergey
  • 180
  • 1
  • 9
0
votes
3 answers

How to store outlook email body in array - Powershell?

the script below reads my outlook emails but how do I access the output. I'm new too Powershell and I'm still getting used to certain things. I just want to get the body of 10 unread outlook emails and store them in an Array called…
Ragnar
  • 1,442
  • 3
  • 16
  • 27
0
votes
1 answer

How to open .ps1 file in PowerShell ISE in c#

I have a file explorer project, it could display all of the files in treeview, some files are .ps1 files, when user click it, I want to use PowerShell ISE to open it. When I use Process.Start(filePath) it always opened with Notepad. Anyone can…
James
  • 2,570
  • 7
  • 34
  • 57
0
votes
1 answer

How to Replace using powershell

Here is my vb code. This is exactly what i want to do with powershell. Public Sub Main() Dim file As New System.IO.StreamReader(Dts.Variables("User::str_SourcePath").Value.ToString()) Dim data As String data = file.ReadToEnd() data =…
Angel_Boy
  • 958
  • 2
  • 7
  • 16
0
votes
1 answer

Installing Windows Features on remote server 2012 using powershell 3.0

I am wondering which is best practice considering both examples will probably work. Using the built in help examples I have written a script to install windows features on remote servers. Here is my code: $servers = ('server1', 'server2', 'server3',…
0
votes
2 answers

The cloud service you have chosen is deployed in a region or affinity group that does not currently support virtual machines

Problem: I am attempting to add a new VM as a second domain contoller to an existing domain and error when attempting to add it to the same Cloud Service. Steps1: Created a virtual network Assigned an Affinity Group to the network (cloudAG) Scripted…
scott_lotus
  • 3,171
  • 22
  • 51
  • 69
0
votes
1 answer

How to get name and in a sequence in Powershell

When I run the below code I get an error with Model Number in which the heading is not being displayed and one more thing is i am unable to get all the three of them in a sequence. $arrComputers = get-Content -Path "C:\Desktop\Computers.txt" …
Illuminati
  • 555
  • 2
  • 7
  • 34
0
votes
3 answers

How to find MAX RAM in powershell

How to find the maximum RAM a computer can be extended upto in powershell. I tried using $colItems3 = get-wmiobject -class "Win32_OperatingSystem" but the answer is not correct
Illuminati
  • 555
  • 2
  • 7
  • 34
0
votes
3 answers

Error in foreach function in powershell

Below is the code snippet i tried but having an error because of it can anyone helpme in editing this one $colItems4 = Get-WMIObject -class Win32_PhysicalMemory | Measure-Object -Property capacity -Sum | foreach ($objItem4 in $colItems4 ) …
Illuminati
  • 555
  • 2
  • 7
  • 34
0
votes
1 answer

How to store data from foreach function in HTML file in powershell and get Physicall ram

I have written a for each file which stores the BIOS information of the systems in a network and the result is being displayed on my console but I want them to be in a HTML file in an order. Code: $arrComputers = get-Content -Path…
0
votes
2 answers

Obtaining Required columns in HTML output in Powershell

I obtained the BIOS data and saved it in HTML file but i don't want all the data to be in the file and i also need to format it so that it could suite my requirement. Code: $bios = get-wmiobject -class "Win32_BIOS" -namespace…
Illuminati
  • 555
  • 2
  • 7
  • 34
0
votes
1 answer

I want to add a random generated password to my newly created Active Directory User

I want to add a randomly generated password to my newly created Active Directory User. I have written a function to generate the password. I am using Powershell V2.0 I tried the below but did not help. Import-Module ActiveDirectory [xml]$dataSource…
0nir
  • 1,345
  • 4
  • 20
  • 41
0
votes
1 answer

Invalid parameter when calling icacls with a variable

When I run this script in Powershell ISE: [System.Threading.Thread]::CurrentThread.CurrentCulture = 'en-us' $folder = Read-Host 'Dove sono le cartelle degli utenti?' $name = Read-Host 'Specificare la cartella dell utente?' takeown /f $folder\$name…
0
votes
2 answers

Set Variable Cannot overwrite variable

Set-Variable helpText -option Constant -value "somevalue" Set-Variable : Cannot overwrite variable helpText because it is read-only or constant. I am getting the below error in power shell. Can some one let me know what I am missing here. Thanks in…
TJK
  • 441
  • 4
  • 11
  • 27
0
votes
5 answers

How to remove some words from all text file in a folder by powershell?

I have a situation that I need to remove some words from all text file in a folder. I know how to do that only in 1 file, but I need to do it automatically for all text files in that folder. I got no idea at all how to do it in powershell. The name…
Blitzcrank
  • 917
  • 2
  • 10
  • 19