kandi X-RAY | Powershell-Modules Summary
kandi X-RAY | Powershell-Modules Summary
Powershell-Modules
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-Modules
Powershell-Modules Key Features
Powershell-Modules Examples and Code Snippets
Community Discussions
Trending Discussions on Powershell-Modules
QUESTION
Some context: I have a PowerShell script that gets information about users and their licenses on Azure, and then saves that information to CSV file. It works locally. My goal is to have this script automatically run on Azure (I'm trying to do it in an Azure Function App) once a month, and then have the created CSV file be emailed to a specified email. However all I want to figure out right now is how to get the list of users so that the script can at least just run without errors.
I have very little experience with PowerShell and Azure Function Apps, so I'm stuck on a few errors I'm getting. I have spent the last few days troubleshooting to no luck.
Here is the beginning of the script that I can run from my local PowerShell:
...ANSWER
Answered 2021-Jun-08 at 21:11Actually, AzureAD needs to be imported a bit differently - it's been a problem for a while per this github issue. This seemed to work for most people:
- Setting the application to run as x64 bit: Function App> Configuration > General Settings > Platform > 64 Bit
- Setting the app to run on Powershell 7 instead of 6 on this thread
- Use:
Import-Module AzureAD -UseWindowsPowerShell
QUESTION
I am running a Powershell script that is able to execute SQL queries using the c# classes:
...ANSWER
Answered 2021-Apr-09 at 06:49ExecuteNonQuery
doesn't return rows. The clue is the "non query" part (it is intended for state-change operations that do not yield rows - UPDATE
, for example). You want ExecuteReader
for row-based data, or ExecuteScalar
for a single cell (the first column of the first row of the first grid). With ExecuteReader
, a typical usage would be (in no specific language):
QUESTION
I am having a difficult time installing/updating my powershell modules. I noticed this when I tried installing DBA Tools moudle. Reference links are https://dbatools.io/download/ and https://github.com/sqlcollaborative/dbatools.
It's a corporate PC. But I know that I have installed other modules before in the past. Does anyone have any idea what's going on?
PS (Admin)>
Install-Module DBATools
- NOTE: The Install-Module command pauses for many minutes before the command returns a warning message.
WARNING: Unable to resolve package source 'https://www.powershellgallery.com/api/v2'. ERROR: "PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'PowerShellGet'".
Update-Module PowerShellGet
ERROR: "Update-Module : Module 'PowerShellGet' was not installed by using Install-Module, so it cannot be updated.".
Update-Module PowerShellGet -Force
ERROR: "Update-Module : Module 'PowerShellGet' was not installed by using Install-Module, so it cannot be updated.".
Find-Module dbatools
- NOTE: The Find-Module command pauses for many minutes before the command returns an error message.
ERROR: "No match was found for the specified search criteria and module name 'dbatools'. Try Get-PSRepository to see all available registered module repositories."
Get-PSRepository | fl *
Name : PSGallery
SourceLocation : https://www.powershellgallery.com/api/v2
Trusted : False
Registered : True
InstallationPolicy : Untrusted
PackageManagementProvider : NuGet
PublishLocation : https://www.powershellgallery.com/api/v2/package/
ScriptSourceLocation : https://www.powershellgallery.com/api/v2/items/psscript
ScriptPublishLocation : https://www.powershellgallery.com/api/v2/package/
ProviderOptions : {}
Get-Module PackageManagement -ListAvailable
Directory: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version Name ExportedCommands
Binary 1.0.0.1 PackageManagement {Find-Package, Get-Package, Get-PackageProvider, Get-Packa...
Binary 1.0.0.1 PackageManagement {Find-Package, Get-Package, Get-PackageProvider, Get-Packa...
...ANSWER
Answered 2020-Sep-21 at 13:07Try running Register-PSRepository -Default
QUESTION
I created a nuget repository in bintray and I'd like to publish a Powershell module. I've created a package in Bintray and added a version.
First, I added the repository:
Register-PSRepository -Name "Bintray" -SourceLocation "https://api.bintray.com/nuget/{organization}/{repository}" -PublishLocation "https://api.bintray.com/nuget/{organization}/{repository}" -InstallationPolicy Trusted
Then, I try to publish:
Publish-Module -Path . -Repository "Bintray" -NugetApiKey {MyApiKey}
Publish-PSArtifactUtility : Failed to publish module 'MyModule': 'Response status code does not indicate success: 401 (Unauthorized)'
I've checked my API key, my user is a "member" and members have "Publish" rights on the repository. There are no restrictions on the repository. The name of the package in Bintray matches the name of the module I'm trying to publish.
I've also tried appending -Credential {UserName}
to the publish command, and entering my password when prompted. The result is always the same.
What did I miss? How can I publish a Powershell module to a Bintray nuget repo?
Editing to update: when I try with the bintry account admin, I instead get error 405 "Not Allowed". This is true using PowerShell Publish-Module
and calling nuget directly. curl
gives me a 400 error: "Error occurred while uploading", as does bintray-cli. The web UI gives a generic error message.
This article says it works with Artifactory; and jfrog calls bintray a "full fledged nuget repository". So why doesn't this work?
...ANSWER
Answered 2020-Oct-31 at 19:05Just to clarify, the only docs available from JFrog are here, and don't help very much:
We were able to create a nuget repository in bintray and tried using the equivalent URLs from bintray as opposed to artifactory without success. We really need something suitable to publish externally to customers (bintray) as opposed to internal artifact management (artifactory) in this case.
QUESTION
I'm trying to follow the documentation on using Powershell to manage Azure Data Lake Gen 2 here but I'm getting a warning and an error when trying to install the PowerShellGet
module. Please see screen shot below.
If I ignore this and carry on with trying to run the next command below I get another error presumably because of the issue with installing PowerShellGet
module above.
ANSWER
Answered 2020-Apr-24 at 01:17Well, I can reproduce your issue with an old version of PowerShellGet
module.
Actually the GA version of Az.Storage 1.14.0
which was released three days ago supports DataLake Gen2, so you could install it directly.
Use the command below, it will install the latest version 1.14.0
for you by default, no need to install PowerShellGet
module.
QUESTION
Following up another question, but from different point of view.
In AzureADPreview powershell module, there is a parameter -PreAuthorizedApplications for Set-AzureADApplication. But neither the cmdlet help nor the documentation page has been updated to detail all these, it was also mentioned here.
I was just wondering, that maybe someone happened to know how to use it and what's the syntax to set the list of preAuthorizedApplication resource type?
...ANSWER
Answered 2019-May-10 at 09:28Summarize my comment:
The command Set-AzureADApplication
essentially calls the Azure AD Graph API, but in Azure AD Graph API, the application
object does not have the preAuthorizedApplications
property, it is just existing in the Microsoft Graph API, which means the feature is not implemented.
Some information you should know:
The old Azure AD Graph API appears to have been abandoned, Microsoft is no longer updating this content of AAD Graph regularly. You can find it in this link.
So you will find this is contradictory to the new feature -preAuthorizedApplications
in the AzureADPreview
. A solution for this is to let the AzureAD PowerShell to call the Microsoft Graph, someone has posted this idea in the azure feedback, you could vote it.
QUESTION
I've written a simple PowerShell cmdlet in C# to show off the problem I'm encountering. Feel free to clone the repo, or fork it and get it working and submit a PR, or just look at the source code to see exactly what I am doing.
I've created a simple PowerShell Core cmdlet using the PowerShellStandard.Library NuGet package. I'm using xUnit and am trying to run a unit test against the PowerShell cmdlet that I've created. The problem is that when I call the .Invoke()
method of the cmdlet instance, it throws a NullReferenceException
.
Here's the cmdlet I've created:
...ANSWER
Answered 2019-Sep-10 at 15:31I experienced this same problem. I was able to resolve this by installing Microsoft.PowerShell.SDK into my unit test project, whereupon my Cmdlet.Invoke()
and Powershell.Create()
calls began working correctly.
QUESTION
I am wanting to execute a PowerShell file stored on Azure storage account from terraform both from locally and from azure.
I included provisioner on my terraform script to execute the PowerShell file
...ANSWER
Answered 2019-Jul-16 at 04:09The error which you got means the command that you use in the local-exec provisioner is not PowerShell command.
To execute the PowerShell script which stores locally. You can use the code like this:
QUESTION
I have written a custom PowerShell module. My custom module uses SharePoint CMD lets. So in my psd1 file I have a nested module property like:
...ANSWER
Answered 2018-Sep-14 at 15:25I ended up creating PowerShell script to load the SharePoint PSSnapin.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Powershell-Modules
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