Windows 10 SSH server installation does not create required services - powershell

I am trying to install Open-SSH on my Windows 10 pc in order to connect to it from my linux machine with ssh. I am following this tutorial, but as soon as I have to run something like Start-Service ssh-agent, it says that the service doesn't exist. Another thing that doesn't work is Install-Module -Force OpenSSHUtils, and it says that the signature of the file 'OpenSSHUtils.psd1' is not valid. I have tried many other tutorials, uninstalling everything before each one, and none of them are working. Is there any way to install these things manually? Am I missing an important step of the installation?

You do know you can install SSH directly in Windows 10 by using Add Feature option, correct? No need to download an external module/tool unless the builtin one does not provide all you are after.
Installation of OpenSSH For Windows Server 2019 and Windows 10
# Install the OpenSSH Client
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
# Install the OpenSSH Server
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Using the GUI
How to Enable and Use Windows 10’s New Built-in SSH Commands
Yet, if you do decide to use external stuff, then, Always test destructive (CUD = Create, Update, delete) code before true implementation.
Find-Module -Name 'OpenSSHUtils' -Verbose
<#
VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2'; IsTrusted = 'False'; IsRegistered = 'True'.
VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2'; IsTrusted = 'False'; IsRegistered = 'True'.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: The -Repository parameter was not specified. PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='OpenSSHUtils'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'OpenSSHUtils'.
Version Name Repository Description
------- ---- ---------- -----------
1.0.0.1 OpenSSHUtils PSGallery Configure OpenSSH for Windows related security settings like file owner and permissions.
#>
Find-Module -Name 'OpenSSHUtils' -Verbose |
Save-Module -Path "$env:USERPROFILE\Documents\WindowsPowerShell\Modules" -Verbose -WhatIf
<#
VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2'; IsTrusted = 'False'; IsRegistered = 'True'.
VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2'; IsTrusted = 'False'; IsRegistered = 'True'.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: The -Repository parameter was not specified. PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='OpenSSHUtils'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'OpenSSHUtils'.
VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2'; IsTrusted = 'False'; IsRegistered = 'True'.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: Using the specified source names : 'PSGallery'.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='OpenSSHUtils'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'OpenSSHUtils'.
What if: Performing the operation "Save Package" on target "'OpenSSHUtils' to location 'C:\Users\Daniel\Documents\WindowsPowerShell\Modules'".
#>
Install-Module -Name 'OpenSSHUtils' -Verbose -WhatIf
<#
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: The -Repository parameter was not specified. PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='OpenSSHUtils'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'OpenSSHUtils'.
What if: Performing the operation "Install-Module" on target "Version '1.0.0.1' of module 'OpenSSHUtils'".
#>

Related

How to fix Nuget Provider "Find-Module" Installation error with PowerShell 7.3?

I've been trying to run a PowerShell script, and upon doing so, I receive a message that NuGet Provider is required.
NuGet provider is required to continue
This version of PowerShellGet requires minimum version '2.8.5.201' of NuGet provider to publish an item to NuGet-based
repositories. The NuGet provider must be available in 'C:\Program Files\PackageManagement\ProviderAssemblies' or
'C:\Users\timothy.granata\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider
by running 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install
and import the NuGet provider now?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"):
If I input Y, an error is returned:
Find-Module: NuGet provider is required to interact with NuGet-based repositories. Please ensure that '2.8.5.201' or newer version of NuGet provider is installed.
If I try running Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force as it recommends, I also get an error:
Install-PackageProvider: Unable to find repository with SourceLocation ''. Use Get-PSRepository to see all available repositories.
And finally, if I run Get-PSRepository, that also errors:
Get-PackageSource: Unable to find module providers (PowerShellGet).
In the script I am trying to debug, the code that seems to trigger this prompt is Install-AWSToolsModule SecurityToken -Force. The surrounding code looks like:
if (-not (Get-Module AWS.Tools.Installer -ListAvailable)) {
Install-Module AWS.Tools.Installer -Force
}
Install-AWSToolsModule SecurityToken -Force
Get-AWSCredential -ListProfileDetail | ForEach-Object {
Remove-AWSCredentialProfile -ProfileName $_.ProfileName -Force
}
I have tried:
Reinstalling PowerShell 7
Making sure I am using TLS 1.2 by running [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Running PowerShell as Administrator
Deleting the Modules folder found in my C:\Users<user>\Documents\WindowsPowerShell folder
I'm unsure what else I can try at this point. How can I install the NuGet provider for use with PowerShell 7.3?
Try
$sourceArgs = #{
Name = 'nuget.org'
Location = 'https://api.nuget.org/v3/index.json'
ProviderName = 'NuGet'
}
Register-PackageSource #sourceArgs
Get-PackageProvider | where name -eq 'nuget' | Install-PackageProvider
EDIT
Perhaps try
Invoke-WebRequest 'https://www.powershellgallery.com/api/v2/package/PackageManagement/1.4.8.1' -OutFile $env:temp\nuget.zip
And confirm you're able to download the nuget package. If so, then try
Expand-Archive $env:temp\nuget.zip -DestinationPath 'C:\Program Files\PowerShell\7\Modules\PackageManagement' -Force
Import-Module PackageManagement -Verbose -Force
It seems something with OneDrive was indeed throwing this off as I wondered in my one comment. I found this post which stated (from some Microsoft Documentation):
The user-specific CurrentUser location on Windows is the PowerShell\Modules folder located in the Documents location in your user profile ... Microsoft OneDrive can also change the location of your Documents folder.
I ran $env:PSModulePath and sure enough their was a OneDrive location. I ended up doing what the answer on that post suggested, and excluded the PowerShell directory from OneDrive. After doing this, my script seems to work now (it doesn't produce errors, or that prompt). Ever after doing this, the OneDrive location still shows up from the $env:PSModulePath command, but I guess it falls back to the next modules location if it can't find a directory.

Publish-PSArtifactUtility cannot resolve module dependency when publishing even when they are in the same feed

I'm trying to publish a PowerShell module to Azure Artifacts which has a dependency on another module that is hosted in the same Artifacts feed. The idea is that when I install the module locally from the feed, the correct version of the dependency is installed automatically. The problem is that when I run:
Publish-Module -NuGetApiKey "{token}" -Path {path} -Repository "{ArtifactsFeedName}" -Verbose -ErrorAction Stop
I get the following error:
Publish-PSArtifactUtility : PowerShellGet cannot resolve the module dependency '{dependency}' of the module
'{moduleWhichHasDependency}' on the repository '{ArtifactsFeed}'. Verify that the dependent module '{dependency}'
is available in the repository '{ArtifactsFeed}'. If this dependent module '{dependency}' is managed externally,
add it to the ExternalModuleDependencies entry in the PSData section of the module manifest.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1190 char:17
+ Publish-PSArtifactUtility -PSModuleInfo $moduleInfo `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Publish-PSArtifactUtility], InvalidOperationException
+ FullyQualifiedErrorId : UnableToResolveModuleDependency,Publish-PSArtifactUtility
In the manifest, the dependency is added like this:
RequiredModules = #( #{ModuleName = '{dependency}'; ModuleVersion = '1.0.4'; })
Then I tried adding:
ExternalModuleDependencies = #( #{ModuleName = '{dependency}'; ModuleVersion = '1.0.4'; })
The module is published but when I install it locally, it doesn't install the dependency.
This issue seems to have been fixed in the latest version of PowershellGet (2.2 in the PSGallery, version installed on my computer was 1.0.1).
You could also install the latest version of PackageManagement (1.4.3 vs 1.0.1)
See :
Added credential parameter to subsequent calls of Publish-Module/Script. #93
https://github.com/PowerShell/PowerShellGet/pull/93
Implement Publish-Module credential parameter propagation to sub-functions #104
https://github.com/PowerShell/PowerShellGet/pull/104
To do this :
Install-Module PowershellGet -Force #-Scope Current #if you don't want to login as Administrator
However, I have a question for you : how do you manage not to give your Credentials when you call Publish-Module with an Azure Artifact feed ? I know they should be stored in the file nuget.config but I have to give them each time.
Publish-Module -NuGetApiKey "{whatever}" -Credentials "{PSCredentials object}" -Path {path} -Repository "{ArtifactsFeedName}" -Verbose -ErrorAction Stop
expanding on #clientGOOG answer, my version was 2.2.4.1 but i had the same issue, i am publishing to myget and i solved this problem by using a pre-authenticated thread. I did not have to add ExternalModuleDependencies settings to make this work.
With the -Verbose flag I noticed that the "find" process was retrying 3x before giving up.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: Using the specified source names : '{myrepo}'.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://{myorg}.myget.org/F/{myfeed}/api/v3/index.json' and PackageManagementProvider is 'NuGet'.
VERBOSE: Retry downloading 'https://{myorg}.myget.org/F/{myfeed}/api/v3/index.json' for '2' more times
VERBOSE: Retry downloading 'https://{myorg}.myget.org/F/{myfeed}/api/v3/index.json' for '1' more times
VERBOSE: Retry downloading 'https://{myorg}.myget.org/F/{myfeed}/api/v3/index.json' for '0' more times
VERBOSE: Total package yield:'0' for the specified package '{dependent module}'.
Here is my revised code that solved the issue:
Register-PSRepository -Name {MyRepo} "https://{myorg}.myget.org/F/{myfeed}/auth/{apikey}/api/v2"
Publish-Module -Path ($module.path |Split-Path -Parent) -NuGetApiKey $APIKey -Repository {MyRepo} -Verbose -ErrorAction Stop
Note: it still required the NuGetApiKey on the publish but the authenticated feed i would assume is passed down to the "find" call that is failing which is why it now works.

Powershell Binary Module not found but installed

I've created a Binary Powershell Module called ODBCManager. After installing from a feed, I am able to use it's functions successfully, but Get-Module does not find it by name (Get-Module -Name ODBCManager returns null). Get-Module -ListAvailable will show it after a 2 minute query, so it's definitely installed. Also -Verbose on installation says success.
C:\Users\xxxxx> Get-Module -ListAvailable
Directory: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 1.0.1 Microsoft.PowerShell.Operation.V... {Get-OperationValidation, Invoke-OperationValidation}
Binary 0.1.0.1 ODBCManager {Add-OracleODBC, Get-ODBCDrivers, New-OracleODBC}
Binary 1.0.0.1 PackageManagement {Find-Package, Get-Package, Get-PackageProvider, Get-PackageSource...}
Script 3.4.0 Pester {Describe, Context, It, Should...}
Script 1.0.0.1 PowerShellGet {Install-Module, Find-Module, Save-Module, Update-Module...}
Script 1.2 PSReadline {Get-PSReadlineKeyHandler, Set-PSReadlineKeyHandler, Remove-PSReadlineKeyHandler, Get-PSReadlineOption...}
Manifest 20.0 SqlServer {Add-SqlColumnEncryptionKeyValue, Complete-SqlColumnMasterKeyRotation, Get-SqlColumnEncryptionKey, Get-SqlColumnMasterKey...}
Directory: C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 1.0.0.0 ActiveDirectory {Add-ADCentralAccessPolicyMember, Add-ADComputerServiceAccount, Add-ADDomainControllerPasswordReplicationPolicy, Add-ADFineGrainedPasswordPolicySu... Manifest 1.0.0.0 AppBackgroundTask {Disable-AppBackgroundTaskDiagnosticLog, Enable-AppBackgroundTaskDiagnosticLog, Set-AppBackgroundTaskResourcePolicy, Unregister-AppBackgroundTask...} Manifest 2.0.0.0 AppLocker {Get-AppLockerFileInformation, Get-AppLockerPolicy, New-AppLockerPolicy, Set-AppLockerPolicy...}
Manifest 1.0.0.0 AppvClient {Add-AppvClientConnectionGroup, Add-AppvClientPackage, Add-AppvPublishingServer, Disable-Appv...}
Manifest 2.0.0.0 Appx {Add-AppxPackage, Get-AppxPackage, Get-AppxPackageManifest, Remove-AppxPackage...}
Script 1.0.0.0 AssignedAccess {Clear-AssignedAccess, Get-AssignedAccess, Set-AssignedAccess}
Manifest 1.0 BestPractices {Get-BpaModel, Get-BpaResult, Invoke-BpaModel, Set-BpaResult}
......................
Directory: C:\Program Files (x86)\Microsoft SQL Server\120\Tools\PowerShell\Modules
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 1.0 SQLASCMDLETS {Add-RoleMember, Backup-ASDatabase, Invoke-ASCmd, Invoke-ProcessCube...}
Manifest 1.0 SQLPS {Backup-SqlDatabase, Add-SqlAvailabilityDatabase, Add-SqlAvailabilityGroupListenerStaticIp, Disable-SqlAlwaysOn...}
Directory: C:\Program Files (x86)\Microsoft SQL Server\130\Tools\PowerShell\Modules
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 2.0 SQLASCMDLETS {Add-RoleMember, Backup-ASDatabase, Invoke-ASCmd, Invoke-ProcessCube...}
Manifest 1.0 SQLPS {Add-SqlColumnEncryptionKeyValue, Complete-SqlColumnMasterKeyRotation, Get-SqlColumnEncryptionKey, Get-SqlColumnMasterKey...}
C:\Users\xxxxxx> Install-Module -Name ODBCManager -Scope AllUsers -Force -ErrorAction Stop -Verbose
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: The -Repository parameter was not specified. PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2/' and PackageManagementProvider is 'NuGet'.
VERBOSE: An error occurred while sending the request.
VERBOSE: Retry downloading 'https://www.powershellgallery.com/api/v2/' for '2' more times
VERBOSE: An error occurred while sending the request.
VERBOSE: Retry downloading 'https://www.powershellgallery.com/api/v2/' for '1' more times
VERBOSE: An error occurred while sending the request.
VERBOSE: Retry downloading 'https://www.powershellgallery.com/api/v2/' for '0' more times
WARNING: Unable to resolve package source 'https://www.powershellgallery.com/api/v2/'.
VERBOSE: Total package yield:'0' for the specified package 'ODBCManager'.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'http://srv-proget/nuget/QASolutions-PS/' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'http://srv-proget/nuget/QASolutions-PS/FindPackagesById()?id='ODBCManager'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'ODBCManager'.
VERBOSE: Performing the operation "Install-Module" on target "Version '0.1.0.1' of module 'ODBCManager'".
VERBOSE: The installation scope is specified to be 'AllUsers'.
VERBOSE: The specified module will be installed in 'C:\Program Files\WindowsPowerShell\Modules'.
VERBOSE: The specified Location is 'NuGet' and PackageManagementProvider is 'NuGet'.
VERBOSE: Downloading module 'ODBCManager' with version '0.1.0.1' from the repository 'http://srv-proget/nuget/QASolutions-PS/'.
VERBOSE: Searching repository 'http://srv-proget/nuget/QASolutions-PS/FindPackagesById()?id='ODBCManager'' for ''.
VERBOSE: InstallPackage' - name='ODBCManager', version='0.1.0.1',destination='C:\Users\xxxxxxx\AppData\Local\Temp\191916'
VERBOSE: DownloadPackage' - name='ODBCManager', version='0.1.0.1',destination='C:\Users\xxxxxx\AppData\Local\Temp\191916\ODBCManager\ODBCManager.nupkg',
uri='http://srv-proget/nuget/QASolutions-PS/package/ODBCManager/0.1.0.1'
VERBOSE: Downloading 'http://srv-proget/nuget/QASolutions-PS/package/ODBCManager/0.1.0.1'.
VERBOSE: Completed downloading 'http://srv-proget/nuget/QASolutions-PS/package/ODBCManager/0.1.0.1'.
VERBOSE: Completed downloading 'ODBCManager'.
VERBOSE: Hash for package 'ODBCManager' does not match hash provided from the server.
VERBOSE: InstallPackageLocal' - name='ODBCManager', version='0.1.0.1',destination='C:\Users\xxxxxx\AppData\Local\Temp\191916'
VERBOSE: Catalog file 'ODBCManager.cat' is not found in the contents of the module 'ODBCManager' being installed.
VERBOSE: For publisher validation, current module 'ODBCManager' with version '0.1.0.1' with publisher name ''. Is this module signed by Microsoft: 'False'.
VERBOSE: For publisher validation, using the previously-installed module 'ODBCManager' with version '0.1.0.1' under 'C:\Program Files\WindowsPowerShell\Modules\ODBCManager\0.1.0.1' with publisher name ''. Is this module signed by Microsoft: 'False'.
VERBOSE: Module 'ODBCManager' was installed successfully to path 'C:\Program Files\WindowsPowerShell\Modules\ODBCManager\0.1.0.1'.
I have it hosted in ProGet under a Powershell Modules Feed
On Publish, folder name and DLL name are the same
Manifest has been created
Functions export and execute as expected
Manifest:
#{
RootModule = 'ODBCManager.dll'
ModuleVersion = '0.1.0.1' # filled in by cake-build process
CmdletsToExport = '*'
GUID = 'xxx-xxx-xxx-xx-xx'
DotNetFrameworkVersion = '4.0'
Author = 'xxx'
Description = 'PowerShell Binary Module for manipulating ODBCs.'
CompanyName = 'xxx'
Copyright = '(c) 2017 xxx. All rights reserved.'
PrivateData = #{
PSData = #{
ProjectUri = 'xxxxxxxxxx'
LicenseUri = ''
ReleaseNotes = 'First Release'
}
}
}
Have I forgot something? Because I've tried everything.
EDIT: After help from #BenH I was able to research further and found you can call Get-Module -ListAvailable -Name ODBCManager to quickly show your module installed, but not imported. -- For future reference!
Install-Module and Import-Module are different. Get-Module returns all of the Modules that are imported and Get-Module -ListAvailable returns all of the modules that are installed.
Thus your module is "Installed" but not "Imported".
With later versions of PowerShell, modules are dynamically imported if their functions/cmdlets are defined in the exported functions/cmdlets of the .psd1. But until they are imported, Get-Module will not list them.
Try this:
Import-Module ODBCManager
Get-Module ODBCManager

WMF 5.0(RTM) DSC resource not being installed propery

After upgrading to WMF 5.0 DSC seems to be having problems installing my custom class based resource module.
PS C:\Users\alexis.coles.adm> Start-DscConfiguration -ComputerName ComputerName -Credential $autoCred -Path E:\DevResetRuntime\Mofs -Wait -Verbose -Force
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Micr
osoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer ComputerName with user sid S-1-5-21-xxxxxxxxx-3810362189-311025990-3170.
VERBOSE: [ComputerName]: LCM: [ Start Set ]
VERBOSE: [ComputerName]: [DSCEngine] Module SxDeployment_1.11.zip downloaded.
VERBOSE: [ComputerName]: [DSCEngine] Resource SxDeployment version 1.11 installed.
VERBOSE: [ComputerName]: LCM: [ End Set ]
The PowerShell DSC resource C:\Program Files\WindowsPowerShell\Modules\SxDeployment\1.11\DscResources\PsPackageProvider does not contain the corresponding MOF file C:\Program
Files\WindowsPowerShell\Modules\SxDeployment\1.11\DscResources\PsPackageProvider\PsPackageProvider.schema.mof. Could not install module dependencies needed by the configuration.
+ CategoryInfo : ObjectNotFound: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : ProviderSchemaFileNotFound
+ PSComputerName : ComputerName
If I run this on a box that has not been upgraded it installs fine and the module is downloaded from the Resource Module Manager and extracted to the correct location.
However running this on an upgraded box only creates an empty SxDeployment folder in C:\program files\windowsPowershell\Modules.
If I copy the good extracted folder from an un-upgraded box to the new box the configuration runs fine.
Any ideas?
UPDATE
My resource zip file is named SxDeployment_1.27.zip
It just contains the following 2 files
SxDeployment.psd1
SxDeployment.psm1
I am expecting this to get extracted to the following files system structure:
Modules
SxDeployment
1.27
SxDeployment.psd1
SxDeployment.psm1
However all I get is
Modules
SxDeployment

Azure Files share doesn't Work

I've trying to create a share in Azure Files, but doesn't seem to work. I'm aware I have to create a new storage account, because it won't work with existing ones. So I have just deleted my empty storage account and re-created it.
Then I'm following the guide using Windows Azure PowerShell, but it gives the following error:
The remote name could not be resolved: 'storageaccountname.file.core.windows.net'
Note that I've replaced my storage account name with 'storageaccountname' and the key with 'storageaccountkey'.
PS C:\System\AzureStorageFile> import-module .\AzureStorageFile.psd1
VERBOSE: Loading module from path 'C:\System\AzureStorageFile\AzureStorageFile.psd1'.
VERBOSE: Loading 'TypesToProcess' from path 'C:\System\AzureStorageFile\Microsoft.WindowsAzure.Commands.Storage.File.types.ps1xml'.
VERBOSE: Loading 'FormatsToProcess' from path 'C:\System\AzureStorageFile\Microsoft.WindowsAzure.Commands.Storage.File.format.ps1xml'.
VERBOSE: Loading module from path 'C:\System\AzureStorageFile\Microsoft.WindowsAzure.Commands.Storage.File.dll'.
VERBOSE: Importing cmdlet 'Get-AzureStorageFile'.
VERBOSE: Importing cmdlet 'Remove-AzureStorageFile'.
VERBOSE: Importing cmdlet 'Set-AzureStorageFileContent'.
VERBOSE: Importing cmdlet 'Get-AzureStorageFileContent'.
VERBOSE: Importing cmdlet 'Get-AzureStorageShare'.
VERBOSE: Importing cmdlet 'New-AzureStorageDirectory'.
VERBOSE: Importing cmdlet 'New-AzureStorageShare'.
VERBOSE: Importing cmdlet 'Remove-AzureStorageDirectory'.
VERBOSE: Importing cmdlet 'Remove-AzureStorageShare'.
VERBOSE: Importing cmdlet 'New-AzureStorageContext'.
VERBOSE: Exporting cmdlet 'Get-AzureStorageFile'.
VERBOSE: Exporting cmdlet 'Remove-AzureStorageFile'.
VERBOSE: Exporting cmdlet 'Set-AzureStorageFileContent'.
VERBOSE: Exporting cmdlet 'Get-AzureStorageFileContent'.
VERBOSE: Exporting cmdlet 'Get-AzureStorageShare'.
VERBOSE: Exporting cmdlet 'New-AzureStorageDirectory'.
VERBOSE: Exporting cmdlet 'New-AzureStorageShare'.
VERBOSE: Exporting cmdlet 'Remove-AzureStorageDirectory'.
VERBOSE: Exporting cmdlet 'Remove-AzureStorageShare'.
VERBOSE: Exporting cmdlet 'New-AzureStorageContext'.
VERBOSE: Importing cmdlet 'Get-AzureStorageFile'.
VERBOSE: Importing cmdlet 'Get-AzureStorageFileContent'.
VERBOSE: Importing cmdlet 'Get-AzureStorageShare'.
VERBOSE: Importing cmdlet 'New-AzureStorageContext'.
VERBOSE: Importing cmdlet 'New-AzureStorageDirectory'.
VERBOSE: Importing cmdlet 'New-AzureStorageShare'.
VERBOSE: Importing cmdlet 'Remove-AzureStorageDirectory'.
VERBOSE: Importing cmdlet 'Remove-AzureStorageFile'.
VERBOSE: Importing cmdlet 'Remove-AzureStorageShare'.
VERBOSE: Importing cmdlet 'Set-AzureStorageFileContent'.
PS C:\System\AzureStorageFile> $ctx = New-AzureStorageContext storageaccountname storageaccountkey
PS C:\System\AzureStorageFile> $s = New-AzureStorageShare data -Context $ctx
New-AzureStorageShare : The remote name could not be resolved: 'storageaccountname.file.core.windows.net'
At line:1 char:6
+ $s = New-AzureStorageShare data -Context $ctx
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Microsoft.Windo...ureStorageShare:NewAzureStorageShare) [New-AzureStorageShare], StorageException
+ FullyQualifiedErrorId : NameResolutionFailure,Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet.NewAzureStorageShare
Azure Files is still in preview mode and is not automatically enabled. Follow the steps at http://blogs.msdn.com/b/windowsazurestorage/archive/2014/05/12/introducing-microsoft-azure-file-service.aspx. The first step asks you to go to http://www.windowsazure.com/en-us/services/preview/ to sign up for the Azure Files Preview feature. Once you sign up for the preview you will have to wait until you get an email letting you know you are approved for the feature.
Is your storage account name you are using “'storageaccountname”? If so, and you just created the storage account, then it appears the subscription you are using hasn’t been approved for the preview yet, which will result in the 'storageaccountname.file.core.windows.net' not resolving.
If you need access then follow the instructions here:
http://blogs.msdn.com/b/windowsazurestorage/archive/2014/05/12/introducing-microsoft-azure-file-service.aspx
Note, we are slowly opening up access, so based on the very high demand the wait may be awhile. You will receive email once your access is approved. Thanks.
Stupid question, but did you try already with creating a new one with a different name?