Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 167935

Windows PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language built on the .NET Framework. PowerShell provides full access to COM and WMI, enabling administrators to perform administrative tasks on both local and remote Windows systems as well as WS-Management and CIM enabling management of remote Linux systems and network devices.

1 vote
Accepted

Restarts specific services across 8 servers

I don't understand why you build a coplicated structure with separate $server variables. You have a list of server names with associated services. That's a simple list that could be contained in a …
LotPings's user avatar
  • 328
2 votes
Accepted

Rename jpg images using a script

The name Picture Database is not quite correct, as it is a Picture Location Database. I would use a csv to store the elements and use Import-Csv to read data in. I have a small problem with the …
LotPings's user avatar
  • 328
1 vote
Accepted

Finding a string in a text file and reporting full file name and size

Using findstr in PowerShell is superfluous and not very powershell'ish which is about objects and pipes. …
LotPings's user avatar
  • 328
1 vote
Accepted

Removing duplicate audio files with different UTC timestamps in filenames, using PowerShell 5

While -Filter is usually the fastest way as it handled by the provider, I'm not sure this is true compared to one -Include with an array which only recurses once instead of 8 times. $Include = '*.cli …
LotPings's user avatar
  • 328
2 votes

Check multiple subdirectories and delete if file exists

Your approach is very inefficient the array $txtfile is already in memory iterating it and per entry searching recursivly the directories (the var $dir in fact also includes files) creates a lot …
LotPings's user avatar
  • 328
0 votes

Determine the third octet of an IP address based on user entered site number

See the following as an incomplete and untested template, ATM too tired to distinguish between parens and curly braces. $global:site = Read-Host 'What is the 4 digit site number?' #must include leadi …
LotPings's user avatar
  • 328
1 vote

ImportExcel for Dataset with Multiple tables

If the Excel sheet names should retain the original TableNames this could do: (can't test myself) The code contains two commented out alternatives. # your code upto $connection.Close() ... $DataToGa …
LotPings's user avatar
  • 328
2 votes
Accepted

How could I have made this Powershell script that executes robocopy code better

If you don't want an external csv file, use an internal one - simulated with a here string and ConvertFrom-Csv in a date format specifier upper case MM are for month, minutes are lower case mm the fo …
LotPings's user avatar
  • 328
1 vote

Bulkloading xml's into Oracle table

As the ctl file can't be parameterized you'll have to create them for each infile. As it is quite small, I'd create it on the fly from a here string with the format operator. This sample script just …
LotPings's user avatar
  • 328
2 votes

Get owner of ~5 million files and folders using Powershell and Robocopy

Your robocopy command lists /NC and /NJH twice. $Folders and $Folder contain objects with properties, use these instead of treating them as strings (which implicit casts them as such) or pipe to Sele …
LotPings's user avatar
  • 328
1 vote

Euler Problem 7 (finding the 10001st prime) in Powershell

I'd start with removing redundancy measuring the time automatically output to screen slows down, comment it out depending on the speed of the computer used I get results of ~74..120 seconds. Comp …
LotPings's user avatar
  • 328
1 vote

Search files content fast in powershell

I also suggest to use a better RegEx but stay with PowerShell. …
LotPings's user avatar
  • 328