Powershell-Scripts | Helpful list of powershell scripts | Command Line Interface library
kandi X-RAY | Powershell-Scripts Summary
kandi X-RAY | Powershell-Scripts Summary
Over the past year or so I have been collecting simple powershell scripts that I find useful and often use on a regular basis. These have all been tested and all have worked for me, however, if any do not work let me know and I'll see if I can work out whats gone wrong. I am in no way an expert on Powershell and most of these I have found online and then simply altered to fit my own purposes. Feel free to use any and if you have any others that you think I am missing let me know! Once again, these are mostly very simple but get the job done for what I need to do!. I should add, some of these are set up to be used stand alone, whereas some are set up for you to be signed in and have loaded the O365 module to use them. If this is the case simply look at the file named "1) PowerShell - NEW LOGIN .txt". You can either access the files as .txt which are within the folder or simply use the .ps1 files which show the syntax. License can be found at:
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Powershell-Scripts
Powershell-Scripts Key Features
Powershell-Scripts Examples and Code Snippets
Community Discussions
Trending Discussions on Powershell-Scripts
QUESTION
Hi I have Procedure with following definition
...ANSWER
Answered 2020-Dec-20 at 14:07You wouldn't use SqlDataAdapter here (or almost ever). Just use SqlCommand.ExecuteNonQuery, and then read the output parameter value. Also use parameters for the other stored procedure arguments. eg
QUESTION
I have a Hash Table like this:
...ANSWER
Answered 2018-Sep-05 at 06:59From MS documentation:
QUESTION
I have multiple variables, containing Information about my Servers. e.g
...ANSWER
Answered 2020-Jan-28 at 13:37Here's one way to do it.
QUESTION
Well, yes, that's a thing. After trying to run the PS script directly and failing, let's try the roundabout way of running it from a node script, which are legit in the GitHub actions environment. So after many attempts, here's my last one (taken from this answer:
...ANSWER
Answered 2019-Dec-04 at 22:35The workspace is actually different from the location of your files in your repo.
In nodejs, you can write the following to get your current working directory and its files:
QUESTION
I get results from a SQL Table with this command:
$GetData = Invoke-Sqlcmd -ConnectionString $Connection -Query $GetQuery
One single result looks like this (there are about 500 of these results):
...ANSWER
Answered 2019-Oct-23 at 13:57Below code should do what you want:
QUESTION
I was trying to learn how to use powershell within C# I was following this tutorial
However when I run it I get this error:
Unhandled exception. System.InvalidProgramException: Common Language Runtime detected an invalid program. at System.Management.Automation.PowerShell.Create() at desktopAdmin365.Program.Main(String[] args) in C:\Users\ncox\source\repos\desktopAdmin365\Program.cs:line 11
C:\Users\ncox\source\repos\desktopAdmin365\bin\Debug\netcoreapp3.0\desktopAdmin365.exe (process 17464) exited with code -532462766.
I am sure I'm missing something when including references/dependencies from the solutions explorer but I am not having any luck with google finding out which one
Here is the code
...ANSWER
Answered 2019-Sep-28 at 01:24If you look at your dependencies in the project, you'll likely see a warning about the package being restored using .NETFramework and possibly not being compatible.
Your project is .NET core, so you might need to install Powershell Core instead.
Alternatively, switch to a .net framework solution and it will work.
QUESTION
I am very much new to Powershell and I am trying to add a default value to two parameters in a script file but I am still being asked to enter the missing parameter at execution.
The parameters are
...ANSWER
Answered 2019-Apr-06 at 11:07When defining optional parameters with a default value, you can either leave out the parameter in the call to have the script use this default value, or use it to have the script use something else instead of the default value.
As an example. This script will simply output whatever is used for the $Build
and $Deploy
parameters:
QUESTION
I have a problem with a Powershell script in VS (C#).
Summary: I build a little tool for specific client actions for Microsoft System Center.
The following runs perfectly:
...ANSWER
Answered 2017-Sep-13 at 18:56Try to use a verbatim string instead:
QUESTION
I can create a DateTime
Object from a string like this:
[datetime]"10.12.2018"
Problem is, it will always take American DateTime
...ANSWER
Answered 2019-Mar-06 at 13:27Call DateTime.Parse()
with a CultureInfo
instance:
QUESTION
I've PowerShell Module
(lets call it PSModule
) in which I've defined as follows in .psd1
ANSWER
Answered 2019-Feb-22 at 01:40To work around this issue I've opted to use Add-Type
with C# code that is compiled on demand instead of PowerShell's own enum
construct. It works.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Powershell-Scripts
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page