Topics and problems related specifically to Windows PowerShell 2.0. PowerShell 2.0 shipped with the releases of Windows 7 and Windows Server 2008 R2. For general PowerShell topics, use the `PowerShell` tag.
0
votes
0answers
10 views
Problems in reading a commandline json object using powershell
I have a powershell script "test.ps1" which takes a json string as a command line input & tries to parse it.
The powershell script is as below -
param(
[string]$json = $(throw 'test')
)
...
0
votes
0answers
8 views
powershell share permisssion level on a folder
Have some problems with setting share permissions to folder.
Cant understand in which mode to set permission to a User Domain\User
NET SHARE testfolder=C:\test /GRANT:Everyone,FULL set NTFS ...
0
votes
2answers
31 views
changing the system time format on windows 7
Well I am looking for a method to change the default windows 7 time format for a system.
So if a system uses like 10PM or 10 AM as default time notation, then i like to change that system to 10:00 or ...
0
votes
0answers
26 views
Why does Get-ChildItem -Filter include results which seemingly violate the filter?
I'm listing the filtered contents of a directory, and I would expect that a filter of "2007*" would retrieve everything present which begins with the digits 2007. However I also get results returned ...
0
votes
1answer
35 views
How to execute PowerShell script against all CSV files in a directory?
I have a script below that I want to execute against all .csv files in a directory. I know I can use Get-ChildItems, but how to filter it for only .csv files in .\ and execute my script?
import-csv ...
0
votes
2answers
22 views
Powershell: how to remove multiple & directories with exceptions?
The Setup
I have a folder structure that looks like:
C:\RootFolder
\file1.txt
\file2.txt
\license.txt
\Settings
\fileA.txt
...
0
votes
1answer
21 views
Read Json Object in Powershell 2.0
I am using Powershell 2.0 (cannot make an upgarde to V3.0 as of now) & I want to read the below Json object.
"{\"DevResults\":[{\"TechnologyName\":\"AD\",\"RuleName\":\"SOA account (user ...
0
votes
1answer
22 views
Disabled ActiveDirectory Users from specific date with exclude list
i wrote a script that gonna disabled old users...
and i need to do an exclude list to it...
the exclude list should be .csv, with 3 columns "Name","SamaccountName","Reason"...
i'm kind of stuck with ...
1
vote
1answer
24 views
Powershell Import-Module fails with DllNotFoundException
Trying to use http://powershellgac.codeplex.com on another computer with powershell 2.0, using it successfully in powershell 3.0 on my main pc but shows this on the other pc:
Get-Module ...
0
votes
0answers
13 views
remote task scheduling on windows 8
I am trying to schedule a task on windows 8 machine remotely from a windows 7 machine.
I am executing the following command in powershell :
schtasks /S "WIN8MACHINE" /U "Administrator" /P "PASSWORD" ...
0
votes
1answer
28 views
Powershell - How to use result of one WMI query in another WMI query?
Trying to list the user permissions of shares on a server, where the share's path has a common file path element in it.
I have a script that successfully uses the Win32_LogicalShareSecuritySetting ...
0
votes
0answers
7 views
How to prevent ADODB.Connection pooling?
I'm using Powershell v2.0, question is in the title. I'm having to use the old school ADOB.Connection (not the OLEDB provider) to open a Jet DB file (.mdb). The reason is simple, the ...
0
votes
1answer
17 views
I don't understand why Select-String isn't matching this
$lines = '<string>D:\home\bob\utility.mdb</string>'
[String[]]$varr = $lines | Select-String -AllMatches -Pattern "<string>*.mdb" |
Select-Object -ExpandProperty Matches |
...
0
votes
1answer
21 views
Extend PowerShell to search/replace and perform on all files in directory?
I have a PowerShell script that converts a CSV file to JSON. I would like to do a search/replace on the JSON file after for "NULL" to null. Also do to run this script against all CSV files in the ...
0
votes
1answer
8 views
read file into line delimeted array
Powershell 2.0, using the 32-bit version. I'm running it via the PowerGUI Script Editor.
Everything online seems to think that Get-Content returns the file as an array, however.
$lines = ...