Description of Windows PowerShell PowerShell is a Windows command-line shell designed especially for system administrators. PowerShell includes an interactive prompt and a scripting environment that can be used independently or in combination. (Source) Along with interacting with the PowerShell ...
1
vote
0answers
10 views
How should I create a reusable “log” object in Powershell?
I'm new to PowerShell and am writing my first application. The application will check the state of a Windows service and (depending on a number of factors) can do a number of things, such as stop it, ...
0
votes
1answer
8 views
Trouble creating symlink with semicolon in it from powershell
So i normally use this syntax to create as symbolic link from powershell.
PS C:\> cmd /c mklink LinkName TargetFolder
However there im getting this error when im trying to create a symlink with ...
1
vote
3answers
30 views
Rename first 20 characters of every filename in a file
I am trying to write a script in powershell to remove the first 20 characters of every MP3 filename in a folder, I have created a file 'test.ps' and inserted the powershell code below into it,
gci ...
0
votes
1answer
18 views
Add AUTOTEXT to MS Word Document with Power Shell
I am working on a project where I need to add AUTOTEXT entries like the Page 1 of X listings to the header and footer of a Power Shell generated MS Word document. I have tried extracting ideas from ...
0
votes
1answer
22 views
Possible to use Powershell to select options from a gui?
I have to convert a manual build process to an automated build process. I am going through the process and have identified a couple areas that I am sure how to approach.
I am new to powershell so I ...
0
votes
0answers
9 views
Powershell Editing Xml causing Visual Studio to report Inconsistent Line Ending
Powershell beginner here..
So I've created a Nuget package with a powershell script. The powershell script modifies a xml schema inside my Visual Studio project when it gets installed. Problem ...
0
votes
1answer
23 views
How to include files and folders with 7zip powershell
Im trying to make my powershell script zip up a few files and folders. At the moment I can make my script either zip all files (with no folders included), or zip all files with folders included but ...
3
votes
3answers
40 views
How do I remove carriage returns from text file using Powershell?
I'm outputting the contents of a directory to a txt file using the following command:
$SearchPath="c:\searchpath"
$Outpath="c:\outpath"
Get-ChildItem "$SearchPath" -Recurse | where ...
1
vote
2answers
26 views
Java reads text file with extra whitespace and CRLF
I have a text file generated by PowerShell using the command
GetChild-Item C:\Source\Path | ForEach-Object { $_.Name } > "C:\MyPlace\outfile.txt"
This generates outfile.txt which opens like this ...
0
votes
1answer
26 views
Export-CSV with the path as a variable
I have a script that basically writes down each file and folder on a remote share and dumps it to a csv. Everything works wonderfully (there is still a lot of work to be done on the script itself tho) ...
0
votes
1answer
19 views
Access denied when using powershell on IIS webserver
I have a password reset website for my 0ffice 365 users. It runs powershell commands in the background to reset user passwords. For some reason when I am using VS and I run the browser with the page ...
0
votes
1answer
22 views
[ADSI]::Exists throws an exception instead of returning False
I'm trying to create a user using the ADSI object if it doesn't already exist. Here are the strange results I'm getting
#Check a user that I know exists
[ADSI]::Exists("WinNT://localhost/micah,user") ...
0
votes
2answers
19 views
What is the difference between “.” and [System.ENVIRONMENT]::CurrentDirectory in powershell?
PM> $path = "."
PM> Get-ChildItem $path -filter '.nuget'
Directory: C:\Users\david\Documents\Visual Studio 2010\Projects\...
Mode LastWriteTime Length Name ...
0
votes
1answer
12 views
PowerShell file upload with PhoneGap not retrieving page
I am trying to upload an archive file (a Zip archive if that matters) to an existing API at an external site and while I can get the webclient to connect and get a token to the site the upload never ...
2
votes
0answers
22 views
How can I configure call depth in powershell?
I was just trying things in powershell and got error about call depth being set to 1000 in some test recursive function. I looked on the internet for some info and found that this is due to error ...