Questions tagged [powershell-ise]

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

Filter by
Sorted by
Tagged with
0
votes
3answers
67 views

Regex: Select and Delete everything that is framed in the comments html tags

I have this html code. And I want to select/delete everything that falls between the comments <!-- ARTICOL START --> and <!-- ARTICOL FINAL --> except all those <p class=..</p> ...
-1
votes
0answers
28 views

rename multiple folders each with a different name that is in excel list

I have a folder with many other folders in it. i would like to use powershell to rename every folder in the parent folder a different namee. i have an excel with a list of names in the order i would ...
0
votes
1answer
15 views

Enabled AD Group Members of multiple groups

I'm trying to get only enabled members which are in multiple groups but not sure how to achieve this in the format I want. My current script is as follows. $GroupList = @('GroupA','GroupB' ) $...
0
votes
2answers
136 views

Difference between Echo and Write-Host in PowerShell ISE

I'm starting to learn (beginner) about PowerShell script. I found that echo and Write-Host both can display output in the console screen, so what is the difference between them? I read this question ...
2
votes
1answer
33 views

Echo statement is not working inside ForEach-Object loop unless you use break statement. Why and any alternative to fix this?

I was designing my own function which renames the .ps1 file to .psm1 with the same name of .ps1 file. Example: Add-UdfUser.ps1 will become Add-UdfUser.psm1. It works completely fine. It changes the ...
2
votes
2answers
269 views

Getting error when converting string to formatted datetime in powershell “String was not recognized as a valid DateTime”

I'm retrieving the Media Created column field from file explorer this way: $mCreated = $shellfolder.GetDetailsOf($shellfile, 208); And that works fine. It gives me the string "5/‎7/‎2017 ‏‎4:09 ...
0
votes
0answers
44 views

PowerShell ISE running previously ran script on running new script

PowerShell ISE I have two scripts : A.ps1 and B.ps1 1> I will run A.ps1 Script. It Ran successfully and Logging logs in local file. 2> On running B.ps1 script. Still executing A.Ps1 script in ...
0
votes
1answer
65 views

How to run power shell script using different local admin count

In my computer, I have used 2 local administrator accounts which are inbuilt one(Admin1) and newly created one(Admin2). Both accounts are a member of the Administrator group. I have a PowerShell ...
1
vote
0answers
416 views

Powershell persistent history in the ISE

(EDIT 2: now including the output of Get-Module) In a Powershell prompt I have persistent history across sessions (see this related question). But when I launch the Powershell ISE, I do not have ...
1
vote
1answer
63 views

Powershell: Fails calling function when run as batch

I have created a GUI for my script. The user selects from two lists, and then clicks a button to load the programs. In ISE, everything works fine. However, when run from a batch file, (or *ps1 file ...
2
votes
1answer
1k views

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 ...
0
votes
0answers
62 views

Notice When Window Being Created of Other Thread or Process using Powershell

Is there a way to get a notice when there is a window which has just been load and going to be created (e.g. after clicking a button) within other thread or process? I want to use it in Automation for ...
0
votes
1answer
140 views

Use PsExec to run robocopy

Hi I'm currently making a script that copies a directory to another. I'm currently using this: robocopy $splunkconfig 'C:\Program Files\SplunkUniversalForwarder\etc\apps' /is /it /copyall /mir But ...
0
votes
1answer
72 views

Return a row if a column has a partial or perfect match with CSV in Powershell

Basically, I want to search for a string and return any full or partial matches in a CSV format. Let's say I have an object $Shoes that looks like: "Brand","Style","Color","Price" "Reebok","...
0
votes
1answer
691 views

Finding current open file path in PowerShell ISE

I need to sign the scripts I write within ISE to run them. How can I get the path of the current open file in the active tab?
1
vote
2answers
149 views

Moving folders based on condition

I have many excel files in a single folder like below. +----------------------+ | 01012019_LOC001.xlsx | | 01012019_LOC002.xlsx | | 01012019_LOC003.xlsx | | 02012019_LOC001.xlsx | | 02012019_LOC002....
0
votes
1answer
166 views

sqlcmd hangs when started on powershell Ise

I had sqlcmd - Microsoft command line utility - working on Powershell Ise. After installation of SSMS 17 and newer odbc driver, it stopped working. When I start it, it just hangs. It does works on ...
3
votes
3answers
5k views

PowerShell ISE - Is there a keyboard shortcut for commenting out lines or multiple lines

In PowerShell ISE I would like to comment out a line or multiple lines at once with a keyboard shortcut like how Sublime Text does this. Is this possible to add or remove the # shown in the example ...
0
votes
1answer
422 views

Pick up 2 file extensions in a directory using FileSystemWatcher

I am looking to pick up only pdf and rtf files but I get a result of "true" when echoing the variable $watcher = New-Object System.IO.FileSystemWatcher Write-Host "First line of the script, getting ...
-1
votes
1answer
30 views

How to add SAMAccount to results?

Stuck on how to add SAMAccounts (AD usernames) to the results, can anyone help? Get-Mailbox -ResultSize Unlimited | Get-MailboxPermission | where {$_.user.tostring() -ne "NT AUTHORITY\SELF" -and $_....
1
vote
1answer
108 views

How to check if a server has a fixed IP address using Powershell?

for me to check if the server has a fixed IP address at the moment I go through a long process, as described on the pictures below, in order, and that is for windows server 2016. my question is: is ...
-1
votes
2answers
1k views

Update Registry Key (Change starting day of week in Windows ) via Powershell - Simple and easy not fancy like mentioned below [duplicate]

I am updating a reg key via GPO but it fails to update (Still Dont know why, though looking into it). Is there a way to do it via powershell ? I will include this in logon script. FYI: HKCU\Control ...
0
votes
1answer
2k views

Can we use canonical name to filter Computers?

I ran a command to get Computers in an OU filtering canonical name rather using searchbase. I got error: “A filter was used that uses constructed attributes” What's that? I think it's because ...
1
vote
0answers
702 views

Powershell - Cannot run multiple commands in PS ISE

I was writing command to get member group of a computer and was then performing a remove operation and then again displaying the membership of computer but the third line of code to display new ...
1
vote
1answer
1k views

How to toggle visibility of console pane or hide it in PowerShell ISE

I've started using PowerShell ISE. It shows two panes at start-up namely script pane and console pane. While writing the PowerShell script I don't want to see the console pane. Console pane is ...
0
votes
1answer
527 views

Connecting to remote desktop using Psexec Tool works with Powershell and Cmd but it doesnt work in PowerShell ISE

I use this command psexec \\ip_address -u user_name -p psw cmd to connect to remote desktop to run commands, it works when you use this in Power shell or command prompt but it doesn't work in Power ...
0
votes
1answer
1k views

How do I set Windows PowerShell ISE default theme?

Whenever I change the theme in the PowerShell ISE options on Windows 10 to Light on Light it doesn't keep it when I restart, it goes back to the default Dark on Light. How can I set/force Light on ...
1
vote
2answers
2k views

Setting explorer size in windows using the Custom Set-Window Script in Powershell

I'm trying to use the script given in this answer Setting window size and position in PowerShell 5 and 6 to set the height and size of multiple windows explorer windows. Not the internet explroer.. ...
3
votes
1answer
2k views

In Powershell, what is the difference between -Property and -ExpandProperty?

Running the cmdlets, the outputs are slightly different, and I'm just trying to understand the difference between the two cmdlets and why you would use one over the other. Example: Get-Date | Select ...
1
vote
1answer
64 views

How can I store a Powershell variable's value as a string while creating ISE submenus

I can't seem to articulate my issue well enough within the search engines to find the answer I'm looking for, so I turn to the community for help: I want to populate my Powershell ISE's menu with ...
1
vote
2answers
904 views

PowerShell ISE - Unexpected Error

I don't get the autocomplete suggestions anymore in PowerShell. In the shell itself I only get a weird little dot where the suggestion should be and when I hit CTRL - spacebar in the script pane in ...
0
votes
0answers
258 views

Powershell ISE: Closing a PowerShell Tab does not unlock a dynamically loaded .NET assembly

Please consider the following scenario. Launch Windows Powershell ISE (64 bit) Create a new PowerShell Tab Create a new PS script which loads a custom assembly by invoking [System.Reflection....
1
vote
1answer
936 views

Windows 10 and RDC Manager v2.7 missing cursor PowerShell ISE

In Windows 7 no problems. Last week had to upgrade to Windows 10. Now I my mouse cursor disappears in the PowerShell ISE in Server 2012 R2. I tried [Console]::CursorSize = 25 from another post, but ...
1
vote
0answers
274 views

Change PowerShell ISE Keyboard Shortcuts

Is it possible with a registry hack or another mechanism to change the default shortcuts in PowerShell ISE? I'd like to modify the debugging shortcuts to be keys that I use in other applications for ...
1
vote
1answer
217 views

How to Keep ISEModuleBrowserAddon from Disappearing in Powershell ISE?

Every time I close and re-start Powershell ISE the Module Browser disappears and I have to re-import the module. Is this just poor intended behavior? Sort of a nuisance to have to Import-Module ...
0
votes
0answers
3k views

PowerShell ISE - Wrapped Find/Replace

The find/replace of Powershell ISE doesn't wrap the search (go back to top of file after end of file) (like seen in Notepad++). Is there a setting to toggle this? Seems to be the first editor I've ...
0
votes
0answers
468 views

Is my PowerShell execution environment subtly corrupted?

I don't expect an answer, but I'm hoping for a direction. Sometimes, PowerShell ISE seems to just act, well, weird. The weirdness seems to come out of nowhere. I haven't found a way to reproduce the ...
0
votes
1answer
5k views

create a calculator with Powershell GUI

So hello guys Im trying to creat a calculator. So far I have the GUI finished. But i Need some help with the backgroundfunctions. Example: i type on the buttons 5+6. Now when i press "=" it should set ...
0
votes
1answer
365 views

Copy content of Buttons into the textbox?

So I am trying to program a simple calculator. I have a very simple question. How can I copy the content of a Button into the textbox? z.B copy Button1 with the content 1 into my TextBox This is my ...
1
vote
1answer
675 views

Very slow clipboard copy from Scripting window

I have an issue in PowerShell ISE (Windows 7) where it takes around 2-3 seconds after copying some text from the scripting area before it actually saves into the clipboard. During this time the ISE ...
0
votes
0answers
480 views

Unable run Powershell Command

This is my first foray into Powershell. When I run a Powershell script I get the following error message: PS D:\modules\setup-azure> Setup-Azure Setup-Azure : The term 'Setup-Azure' is not ...
1
vote
0answers
700 views

Deleting Duplicate files with similar names in Powershell-ISE

I have a few hundred thousand files to go through which are all sitting in one folder. I need to find and delete the duplicates. The problem is, the duplicate files only have similar names, not ...
1
vote
1answer
542 views

Powershell Script not firing

I'm pretty new to powershell but im executing the following script in PS ISE: $source = "E:\MEX_Websites\Customer_Hosting\MyFolderB\Reports\" $filter = "*.*" $fsw = New-Object System.IO....
4
votes
2answers
2k views

Reverse search in PowerShell ISE wanted

In Bash, you can reverse search your history using Ctrl-R and start typing. Is there a similar feature in Windows PowerShell ISE?
0
votes
1answer
817 views

Run and edit a Perl/Python/non-Powershell - Script in Powershell_ISE (Windows Server)

I am on a Windows Server (2012) with Powershell_ISE and befor installing additional software I wanted to edit and test a script in the Powershell_ISE (it's a better native solution than using notepad +...
0
votes
1answer
716 views

Powershell ISE cannot attach to Docker container / Windows Container

I can connect and attach to a docker container / windows container on Windows 2016 Server just fine with Powershell. But when I try the same with Powershell ISE, I get the error below. PS C:\> ...
1
vote
1answer
3k views

Can I load Powershell AD Module as another user?

I have a script that I use to automate AD and Office 365 account provisioning. Everything is working just fine. The only "problem" is that I have a regular domain account and another account which is ...
3
votes
2answers
864 views

Power Shell Script to export mailbox

I have a script its working and it is programmed to take backup for every mailbox for a month and store it to local shared drive. When I run the script it export whole database instead of specified ...
5
votes
2answers
19k views

Always Run PowerShell ISE As Admin

I have Windows 10 and run some PowerShell commands through the Outlook COM object. This requires PowerShell to be running the same level of access (running as admin or user) as Outlook. As I need ...
1
vote
2answers
3k views

PowerShell ISE open previous files

How can I configure PowerShell ISE so that it will open tabs for each file that was previously opened when I closed it? This is particularly helpful since I typically come back to work on the same ...