text:
[DEV] Bot does not start parsing Config does not work?

Expected Behavior
Bot starting, parsing the config file
Actual Behavior
maestro@sd-93980:~/dev/PokemonGo-Bot$ python pokecli.py   [11:09:43] PokemonGO Bot v1.0   [11:09:43] No config argument specified, checking for /configs/config.json  Traceback (most recent call last):   File "pokecli.py", line 291, in <module>     main()   File "pokecli.py", line 241, in main     config = init_config()   File "pokecli.py", line 64, in init_config     load.update(json.load(data))   File "/usr/lib/python2.7/json/__init__.py", line 291, in load     **kw)   File "/usr/lib/python2.7/json/__init__.py", line 339, in loads     return _default_decoder.decode(s)   File "/usr/lib/python2.7/json/decoder.py", line 364, in decode     obj, end = self.raw_decode(s, idx=_w(s, 0).end())   File "/usr/lib/python2.7/json/decoder.py", line 380, in raw_decode     obj, end = self.scan_once(s, idx) ValueError: Expecting , delimiter: line 3 column 35 (char 66)
Steps to Reproduce
New Dev Downloaded on 28-7 10:00 GMT
Using Default Config file with only my credentials
Other Information
OS: Ubuntu server 16.04

Same issue here on Mac. Already checked the config a few times but it's not an error in the json.

no problem parsing config.json.example in either dev or master. check your config please

@surfaace i use the default one?

Same here. this is my config:
{
"auth_service": "google",
"username": "xxx@gmail.com",
"password": "xxx",
"location": "xxx",
"gmapkey": "xxx",
"max_steps": 5,
"catch_pokemon": true,
"spin_forts": true,
"walk": 4.16,
"action_wait_min": 1,
"action_wait_max": 4,
"debug": false,
"test": false,
"health_record": true,
"location_cache": true,
"distance_unit": "km",
"reconnecting_timeout": 15,
"item_filter": {
"1": { "keep" : 100 },
"101": { "keep" : 10 },
"102": { "keep" : 30 },
"103": { "keep" : 30 },
"201": { "keep" : 30 },
"701": { "keep" : 100 }
},
"evolve_all": "Pidgey,Weedle",
"evolve_speed": 20,
"cp_min": 300,
"use_lucky_egg": false,
"evolve_captured": false,
"release_pokemon": true,
"catch": {
"any": {"catch_above_cp": 0, "catch_above_iv": 0, "logic": "or"}
},
"release": {
"any": {"release_below_cp": 0, "release_below_iv": 0, "logic": "or"},
"Pidgey": {"release_below_cp": 0, "release_below_iv": 0.8", "logic": "or"},
"Rattata": {"always_release": true},
"Zubat": {"release_below_cp": 200, "release_below_iv": 0.8", "logic": "or"}
}
}

@maestroi , Tried with a new copy of the config and not copy pasting anything from a previous one but just filling in. And it did work. So seems indeed invalid.

authors: Bramzor maestroi surfaace

repo: PokemonGoF/PokemonGo-Bot


text:
Newest dev throws error ImportError: No module named gpxpy

Expected Behavior
No error
Actual Behavior
Bot throws error
Traceback (most recent call last):   File "pokecli.py", line 40, in <module>     from pokemongo_bot import PokemonGoBot   File "/opt/PokemonGo-Bot/pokemongo_bot/__init__.py", line 18, in <module>     import navigators   File "/opt/PokemonGo-Bot/pokemongo_bot/navigators/__init__.py", line 2, in <module>     from path_navigator import PathNavigator   File "/opt/PokemonGo-Bot/pokemongo_bot/navigators/path_navigator.py", line 3, in <module>     import gpxpy ImportError: No module named gpxpy
Steps to Reproduce
Install latest dev launch bot from terminal
mate-terminal -x sh -c '(python pokecli.py -cf configs/account1.json) ; exec /bin/bash -i' &

Need to update requirements
pip install -r requirements.txt --upgrade

Thats it thanks.

source: gharchive/issue

authors: Aaranaw mrthrowaway

license: MIT

license_type: permissive

license_source: github-api


text:
-it Flag: "expected one argument"

Expected Behavior
Initial transfer - all pokemon with cp lower than highest are transfered.
Actual Behavior
pokecli.py error: argument -it/--initial_transfer: expected one argument.
(Seems to be expecting an integer)
Steps to Reproduce
Using "-it" or "--initial_transfer" in command line.
Other Information
OS: Windows 10

That integer is CP

Huh, alright. In that case, after some more looking, it will automatically do a initial transfer even without the flag, it seems.

-it requires CP input

authors: IcicleTF lpc921 surfaace


text:
Mc issue 356 set up swagger

Fixes

https://github.com/Police-Data-Accessibility-Project/data-sources-app/issues/356

Description

Updates backend code to provide detailed Swagger API documentation.
Adds slight changes to existing tests to account for cases not previously caught.

Testing

Run all tests in tests directory
Test Swagger API by either accessing root path of Flask app (if running locally), or on /api path of base url if accessing remote web site.

Performance

Performance impact marginal.

Docs

Incorporated within the Swagger API changes.

wow, the endpoints and models up at https://data-sources-v2.pdap.dev/api are so nice. It looks like they don't all have properties—how are those generated?
I made a PR in docs: https://app.gitbook.com/o/-MXypK5ySzExtEzQU6se/s/-MXyolqTg_voOhFyAcr-/~/changes/510/api/v2-api-docs-wip
I wasn't sure about removing the homepage search cache stuff, I don't see it in swagger.

wow, the endpoints and models up at https://data-sources-v2.pdap.dev/api are so nice. It looks like they don't all have properties—how are those generated?

I'm not 100% sure what you mean by properties in this context. However, the general answer to how things are generated is that they are defined within code attached to each Resource as decorators. What parameters are accepted, how they are described, whether they are required, what responses can be returned, all are declared within the relevant Resource class.
In addition, further descriptions can be provided by the docstring for that Resources HTTP methods, and it seems they are amenable to at least some forms of nice-looking formatting (such as bullet points), but I haven't delved too deeply into those.
Anything we want to add or modify to these can be done via changes to the code, at the Resource level.

I wasn't sure about removing the homepage search cache stuff, I don't see it in swagger.

Technically, the homepage search cache endpoint still exists only in v1 and not v2. At the time, we'd developed it just for v1 so we could get it working -- we haven't yet emulated it in v2. Once we migrate it into v2, we can create documentation for it as well!

@maxachis I meant the properties shown on the current swagger docs as example responses. Screenshot attached. Your other issue addressed that, though.

re: the homepage search cache, gotcha! I removed it from the gitbook v2 docs.
https://app.gitbook.com/o/-MXypK5ySzExtEzQU6se/s/-MXyolqTg_voOhFyAcr-/~/changes/510/api/v2-api-docs-wip

source: gharchive/pull-request

authors: josh-chamberlain maxachis


text:
Error reporting

If the Action fails, we should be notified so we can

run it manually, if possible, to cover the outage
fix it

I have no opinion on the contents of the log / email.

Technically, I am receiving email reports when this Action fails. That's not everything we wanted, but what's left to accomplish in keeping this open, @josh-chamberlain?

That's fine with me @thejqs, as long as there's a mechanism to alert you if it breaks

authors: josh-chamberlain thejqs


text:
Get more workers with Google Cloud's free trial

In case this helps anyone: my dataflow job on Google Cloud was restricted to 1 worker, so I added the following argument when launching create_data.py:
--num_workers 8
Now the job was restricted to 4 workers instead due to the quota on external IP addresses. So I turned them off with:
--no_use_public_ips
and enabling Private Google Access for the used region's subnet (us-central1 for me) in the VPC networks section.

Thanks!

The max worker num is 20.

authors: Clovin drunkinlove

repo: PolyAI-LDN/conversational-datasets


text:
Missing translation strings

Cannot fine these on weblate: "Add .jar", "Download mods"

https://hosted.weblate.org/translate/polymc/polymc/pl/?q=Add+.jar
https://hosted.weblate.org/translate/polymc/polymc/pl/?q=Download+mods
And both of these "Mods"

They were added a few days ago: https://github.com/PolyMC/Translations/commit/8f65ab199ae9be92fa3ab8ec0b2a45625c297fee
Not sure how long it takes for Weblate to find them

Ah, ok.
Can this https://github.com/PolyMC/Translations/blob/8f65ab199ae9be92fa3ab8ec0b2a45625c297fee/template.pot#L155
be changed to "About PolyMC" or "About the app" / "About launcher"?
The reason I'm asking for this is just "About" is "O" in Polish which looks odd, instead "O programie"/"O PolyMC" could be used.

This inconsistency is killing me:

https://github.com/PolyMC/Translations/blob/8f65ab199ae9be92fa3ab8ec0b2a45625c297fee/template.pot#L2458

This still isn't updated on Weblate.

Fixed now

Ah, ok.
Can this
https://github.com/PolyMC/Translations/blob/8f65ab199ae9be92fa3ab8ec0b2a45625c297fee/template.pot#L155
be changed to "About PolyMC" or "About the app" / "About launcher"? The reason I'm asking for this is just "About" is "O" in Polish which looks odd, instead "O programie"/"O PolyMC" could be used.

Not sure what to put there in the application. It's the title of the tab in the "About" dialog. Maybe you can just translate it as O programie to convey the context.

authors: RDKRACZ Scrumplex

repo: PolyMC/Translations


text:
Fix shell bundle strategy

Fixed a small bug where the generateShellMergeStrategy was not honoring minEntrypoints and if it wasn't passed in as a 2 it produced incorrect bundles and sometimes it also generated incorrect bundles anyways if the shared bundle happened to come after the shell bundle when the .find method was invoked on bundles set.

My 😠 faces are directed at myself fwiw. 👍

@garlicnation PTAL

@garlicnation and @justinfagnani PTAL WYGAC - There's nothing else to address on the PR that I'm aware of.

repo: Polymer/polymer-bundler

license_source: bigquery


text:
Updated CHANGELOG for a 3.0.0 polymer-bundler release.

[x] CHANGELOG.md has been updated.
[x] README.md has been updated.
The reason this is a major release to 3.0.0 is due to the breaking change of defaulting to polymer 2.x behavior and mapping all old polymer 1.x vulcanize-style url rewriting preferences to the rewriteUrlsInTemplates option.

@katejeffreys and @arthurevans wrt docs: I am unaware of places where polymer-bundler library itself is specifically documented other than its own README.  Are you aware of any?

Plan is to release this 3.0.0 version with the breaking change and then update the 2.x version of polymer-cli to either:

Default rewriteUrlsInTemplates to true, maintaining CLI support for polymer 1.x mirroring old vulcanize behavior.
Default rewriteUrlsInTemplates to true if CLI can identify the version of Polymer in the project is 1.x.  That could be done statically by looking at bower.json (which may be unreliable if install-time resolution made user choose a 2.x version) or by checking the version key of the bower.json within the installed polymer component folder.

Still working that out.

Pretty sure we don't reference the polymer-bundler library anywhere in the docs—certainly not more than a passing mention.  We'll update docs when CLI 2.0 comes out. (That we'll need to coordinate on.)

authors: arthurevans usergenic


text:
Dynamic content and styles on 1.1.3

Still working on an upgrade and just cannot get this to work ...
I have an element that I need to allow dynamic content and external styles set on that content.
So the model is like:
{
    html: '
text
',
    css: 'div { color: blue; } body { background: yellow; }'
}

In previous versions of polymer, at least .5 and .8 this was possible, but I thought it was working in 1.0 also. However, it is breaking now and I need a work around.
This was my best shot, but the styles were not applied on the 'div', however the body was yellow:
(ya there is some jquery in there)
, _modelChanged: function(n) {
    this._injectModelHTML();
    this._setStylesOnDynamicContent();
}

, _setStylesOnDynamicContent: function(n) {

    // Scope dynamic content first
    var innerContent = $(this).find('.inner-content').first().get(0);
    this.scopeSubtree(innerContent, true);

    // Now add our styles to the style doc
    this._injectStyleTag();

    // ???
    // Polymer.Base._prepStyles();

    // Now update styles
    this.updateStyles();
}

, _injectModelHTML: function() {
    this.$.content.innerHTML = this.model.html;
}

, _injectStyleTag: function() {
    $(this).append('');
}

Does anyone know of a way to add dynamic css then apply it to dynamic content?

+1

Ok, guys, I needed to solve this so this was my solution for anybody else who needs to do something like this.
I made a behavior with these mehtods:
// Copied from a closure inside scopeSubtree() here:
// https://github.com/Polymer/polymer/blob/master/src/standard/styling.html#L120

_scopify: function(node, nodeName) { var self = this;
    // node.className = self._scopeElementClass(node, nodeName);
    var n$ = node.querySelectorAll('*');
    Array.prototype.forEach.call(n$, function(n) {
        if(n.nodeName==='TEMPLATE'){
            return;
        }
        this._addElementStyle(n, nodeName);
        // n.className = self._scopeElementClass(n, nodeName);
    }.bind(this));
}

// Mostly from here: https://github.com/Polymer/polymer/blob/master/src/lib/style-transformer.html#L73

, _addElementStyle: function(element, scope) { var self = this;
    // note: svg on IE does not have classList so fallback to class
    if (element.classList) {
      element.classList.add(scope);
    } else if (element.getAttribute) {
      element.setAttribute('class', c + (c ? ' ' : '') + ' ' + scope);
    }
}

// https://github.com/Polymer/polymer/blob/master/src/lib/style-transformer.html#L114

, _prepareModelCss: function(styleText, scope) { var self = this;
    return Polymer.StyleTransformer.css(styleText, scope);
}

Most of that code is from polymer, but I could not reuse the pieces I needed, so I made that small behavior.
So basically this is the sequence to achieve the goal:

The element loads and has a model property (like a Backbone model object JSON)

The model.html gets injected into the element's content

Scope the element with model.id self._scopify(this, 'guid-'+self.model.guid);

Then scope and add the model.css (note not custom-style):

var prepped = self._prepareModelCss(self.model.css, 'guid-'+self.model.guid);
$(self).append('');

Now all of the model.css rules are applied to element and safely scoped.
If there is a better way to do this with Polymer itself as is, I could not find it.

Ref: https://github.com/Polymer/polymer/pull/3362#issuecomment-179567407

Closing this per above comment. For CSS you can use CSS variables, for HTML you can write the logic yourself. Since it would be unsafe to directly assign (see discussion in #3362) we are not allowing this feature.

authors: TimvdLippe jmcgdz justjico

repo: Polymer/polymer


text:
Add support for building versions of Polymer with and without verbose error messages

Right now Polymer includes relatively few error and warning messages. We've instead recommended using Polylint.
However, users have requested a tool-free way to use a development mode of Polymer that produces more verbose warnings and errors. We're open to this idea, but these warnings cannot be included in the production build of Polymer. We need to add support for including or not these errors/warnings in a build and then we can easily make the two versions available.

checkout:
https://github.com/mishoo/UglifyJS2 under drop_console <--- seems like all we should need right?

we could also use conditional compilation if we want a bit more control, simple enough :)
https://github.com/mishoo/UglifyJS2#conditional-compilation

authors: samccone sorvell


text:
Compatibility set method no longer accepts third argument

In Polymer 1.x, a user could update an arbitrary object via the following usage of this.set:
Polymer({
  // ...
  someMethod: function() {
    var myObject = {
      foo: 1
    };
    this.set('foo', 2, myObject);
  }
});

However, set in Polymer 2.0-preview does not support this third-argument usage.

I remember that I proposed to remove this third argument. What's the use case here?

The use case is API compatibility with 1.0. Yes, the argument is vestigial,
but it is no less used in the real world and will impact hybrid-mode
migrations to 2.0.
On Wed, Sep 14, 2016, 9:37 AM herr kaste notifications@github.com wrote:

I remember that I proposed to remove this third argument. What's the use
case here?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Polymer/polymer/issues/3953#issuecomment-247074600,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAOp0xUAODryCcwRfXcdPLkB6MI9Qkroks5qqCLegaJpZM4J8SDG
.

Resolved by https://github.com/Polymer/polymer/pull/3970

/cc @e111077 this is one that was affecting app-pouchdb

authors: cdata kaste kevinpschaaf


text:
Fragment's in polymer.json don't support globs, causes silent build failure

Currently you have to list out each fragment manually, which causes another point of redundancy when trying to use unanalyzable dynamic imports, requiring many lines of fragments verses one, eg.
"fragments": ["src/**/my-view-*.js"]

Currently this is causing silent build failure, only giving the output:
$ polymer build

info: [cli.command.build]    Clearing build\ directory...
info: [cli.build.build]    (es6-unbundled) Building...

$ |

If i add fragment options then node_modules is not creating since i enabled npm: true option

authors: arokia-innominds jsilvermist

repo: Polymer/tools


text:
[Build] Allow passing a StreamTransform to projectOptions

Allow passing a StreamTransform to projectOptions.
This StreamTransform should be applied on loaded files sources and / or dependencies, before they are analysed.
It will allow modifying files with a custom build, before they are analysed, therefore analysis will be correct (if the modification changed dependencies as it could when we are changing the build target).
This is currently not possible without copying the whole source directory in a temporary directory, which is very inefficient considering we have to copy the whole unfiltered dependencies

Please consider it


text:
UglifyJS overmangles envCachesTemplates

Okay, in
const envCachesTemplates =
    ((t) => t() === t())(() => ((s) => s) ``)

Out:
const envCachesTemplates=(e=>e()==e())(()=>e=>e``);

which will evaluate to false.

It seems to be fixed in TypeScript v2.6. Shouldn't this fix be removed to reduce library size?

authors: Lodin kaste

repo: PolymerLabs/lit-html


text:
Fixes #55

This fixes issue #55 under windows. I've not tested on other operating systems though

I signed it!

repo: PolymerLabs/polylint


text:
Feature-Flag not loaded

Version
4.4.1
Steps to Reproduce

Call await getFeatureFlagPayload(key) right after Posthog() initialization/creation

Similar issue to https://posthog.com/questions/feature-flag-not-working
Expected Result

Future waits until flags are loaded
Or a similar api to JS onFeatureFlags()

Actual Result
Sometimes getFeatureFlagPayload() returns the payload, sometimes it returns null.
Also there's no way to ensure Feature Flags are loaded, other than adding an artificial delay?

Hi @nrobi144
That is a dupe of https://github.com/PostHog/posthog-flutter/issues/81
The await is only about the bridge call but not the whole flags to be loaded, this still has to be implemented.
The flags are cached in the disk, so technically if you want to use flags right after init, you just need the artificial delay once, the very first time the app opens and has internet, all the following times will be read from the disk if the flags request isn't finished in time.

repo: PostHog/posthog-flutter


text:
Add files via upload

Updated-Twenty-Twenty-One

Ready now -      Updated-Twenty-Twenty-One

Ready now -      Updated-Twenty-Twenty-One

repo: Pouchmouse/Procedural-Planet-Tutorial


text:
Missing DSC Module xOU

Hi all,
hope that's the right way for contributing my question.
Just wondering why the Module xOu from [PowershellGallery.com] (https://www.powershellgallery.com/packages/xOU/) is missing here?
Is there any reason for, which I haven't found yet?
I'm trying to configure my OUs and I thought I could do that with the xADOrganizationalUnit Resource.
Or is there an other way to configure Active Directory OUs?

without verifying it, but it seems like that issue has been solved. DSC Resource xActiveDirectory
contains now  MSFT_xADOrganizationalUnit.

repo: PowerShell/DscResources

license: mit


text:
Readme Order

The order in the Readme will cause an error on step:
Start-DscConfiguration -Path .\PSPrivateGalleryPublish -Wait -Force -Verbose
To fix this move the cmdlet up:
New-NetFirewallRule -Name PSGallery -DisplayName "PSGallery" -Description "Allow access to the PSGallery" -Protocol TCP -RemoteAddress Any -LocalPort 8080 -Action Allow -enabled True

The line Start-DscConfiguration -Path .\PSPrivateGalleryPublish -Wait -Force -Verbose isnt in the readme, but New-NetFirewallRule does want moving before trying to find a module so have created a PR for that.

@JulienFloris Thanks for pointing to the issue.
@davidwallis3101 Thanks for the PR. Accepted!

repo: PowerShell/PSPrivateGallery


text:
Script Analyzer shouldn't use AddScript for anything

The AddScript API opens the possibility of code injection in Script Analyzer. The AddCommand API prevents this.

Thanks for the issue, Lee
Fix is available in Development branch now.

authors: LeeHolmes raghushantha

repo: PowerShell/PSScriptAnalyzer


text:
CommandInfo.ResolveParameter throws NullReferenceException sometimes

From https://github.com/PowerShell/PSScriptAnalyzer/issues/1538.
PSScriptAnalyzer tries to get the value of Export-ModuleMember's parameters by calling the CommandInfo.ResolveParameter() call here.
This calls into PowerShell here:
https://github.com/PowerShell/PowerShell/blob/b1e998046e12ebe5da9dee479f20d479aa2256d7/src/System.Management.Automation/engine/CommandInfo.cs#L593-L605
As with various other CommandInfo members, this appears not to be threadsafe and the call sometimes throws an NRE.

related: #12865

repo: PowerShell/PowerShell


text:
Using ToString on DateTime object after using AddDays produces incorrect month

Prerequisites

[X] Write a descriptive title.
[X] Make sure you are able to repro it on the latest released version
[X] Search the existing issues.
[X] Refer to the FAQ.
[X] Refer to Differences between Windows PowerShell 5.1 and PowerShell.

Steps to reproduce
PS>  $d = [DateTime]::ParseExact('2020-01-01', 'yyyy-mm-dd', $null)
PS> $d = $d.AddDays(31)
PS> $d; $d.ToString('yyyy-mm-dd'); $d.GetDateTimeFormats()[0]
Expected behavior
February 1, 2020 12:01:00 AM
2020-02-01
2020-02-01

Actual behavior
February 1, 2020 12:01:00 AM
2020-01-01
2020-02-01

Error details
No response
Environment data
Name                           Value
----                           -----
PSVersion                      7.2.0-preview.10
PSEdition                      Core
GitCommitId                    7.2.0-preview.10
OS                             Microsoft Windows 10.0.19043
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals
No response

'yyyy-mm-dd' -- year-minutes-days

Thanks. I had assumed that "mm" would be month since "%m" is for month.


text:
pscustomobject comes back with null You cannot call a method on a null-valued expression on powershell 7.3.1

Prerequisites

[X] Write a descriptive title.
[X] Make sure you are able to repro it on the latest released version
[X] Search the existing issues.
[X] Refer to the FAQ.
[X] Refer to Differences between Windows PowerShell 5.1 and PowerShell.

Steps to reproduce
param ([Parameter(
    Mandatory=$true,
    ValueFromPipeline=$true)]
    [string[]]$urls
    )
foreach ($url in $urls){
  $req = [Net.HttpWebRequest]::Create($url)
#$req.GetResponse() | Out-Null
  $output = [PSCustomObject]@{
      URL = $url
     'Cert Start Date' = $req.ServicePoint.Certificate.GetEffectiveDateString()
     'Cert End Date' = $req.ServicePoint.Certificate.GetExpirationDateString()
      }#endCustomobject.
  $output | sort URL
}#endForeach

when I ran this interactive session it works or when I dot source it on powershell 5.1 it works as expected.
However this errors out when I dot source it with in 7.3.1. with message
You cannot call a method on a null-valued expression that is specifcally calling on the $output PScustomobject.
OS is WIn10 enterprise 20J2
build 19042.1466.
Expected behavior
$output pscutomboject will list url and respective dates as it does in Powershell 5.1.

Output example

URL                    Cert Start Date       Cert End Date
---                    ---------------       -------------
https://www.google.com 11/28/2022 1:19:01 AM 2/20/2023 1:19:00 AM

Actual behavior
|  $output = [PSCustomObject]@{
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.

Error details
Exception             :
    Type        : System.Management.Automation.RuntimeException
    ErrorRecord :
        Exception             :
            Type    : System.Management.Automation.ParentContainsErrorRecordException
            Message : You cannot call a method on a null-valued expression.
            HResult : -2146233087
        CategoryInfo          : InvalidOperation: (:) [], ParentContainsErrorRecordException
        FullyQualifiedErrorId : InvokeMethodOnNull
        InvocationInfo        :
            ScriptLineNumber : 9
            OffsetInLine     : 1
            HistoryId        : -1
            ScriptName       : C:\scripts\get-certExpirev2.ps1
            Line             : $output = [PSCustomObject]@{

            PositionMessage  : At C:\scripts\get-certExpirev2.ps1:9 char:1
                               + $output = [PSCustomObject]@{
                               + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            PSScriptRoot     : C:\scripts
            PSCommandPath    : C:\scripts\get-certExpirev2.ps1
            CommandOrigin    : Internal
        ScriptStackTrace      : at <ScriptBlock>, C:\scripts\get-certExpirev2.ps1: line 9
                                at <ScriptBlock>, <No file>: line 1
    TargetSite  : System.Object CallSite.Target(System.Runtime.CompilerServices.Closure,
System.Runtime.CompilerServices.CallSite, System.Object)
    Message     : You cannot call a method on a null-valued expression.
    Data        : System.Collections.ListDictionaryInternal
    Source      : Anonymously Hosted DynamicMethods Assembly
    HResult     : -2146233087
    StackTrace  :
   at CallSite.Target(Closure, CallSite, Object)
   at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
   at System.Management.Automation.Interpreter.DynamicInstruction`2.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
CategoryInfo          : InvalidOperation: (:) [], RuntimeException
FullyQualifiedErrorId : InvokeMethodOnNull
InvocationInfo        :
    ScriptLineNumber : 9
    OffsetInLine     : 1
    HistoryId        : -1
    ScriptName       : C:\scripts\get-certExpirev2.ps1
    Line             : $output = [PSCustomObject]@{

    PositionMessage  : At C:\scripts\get-certExpirev2.ps1:9 char:1
                       + $output = [PSCustomObject]@{
                       + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    PSScriptRoot     : C:\scripts
    PSCommandPath    : C:\scripts\get-certExpirev2.ps1
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, C:\scripts\get-certExpirev2.ps1: line 9
                        at <ScriptBlock>, <No file>: line 1

Environment data
Name                           Value
----                           -----
PSVersion                      7.3.1
PSEdition                      Core
GitCommitId                    7.3.1
OS                             Microsoft Windows 10.0.19042
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals
param ([Parameter(
    Mandatory=$true,
    ValueFromPipeline=$true)]
    [string[]]$url
    )

$req = [Net.HttpWebRequest]::Create($url)
#$req.GetResponse() | Out-Null
$output = [PSCustomObject]@{
    URL = $url
   'Cert Start Date' = $req.ServicePoint.Certificate.GetEffectiveDateString()
   'Cert End Date' = $req.ServicePoint.Certificate.GetExpirationDateString()
}
$output

There was a change between .NET framework (Windows PowerShell up to 5) and .NET Core (PowerShell 6 onwards).
$req.ServicePoint.Certificate is now null .
I have not found code that works for both, so I have two scripts to check certs one for PS 5 and for PS7   The PS7 one has this
# I get the host name and port from the URL (or assume port 443 if there is no port)
             $tcpClient = $stream  = $sslstream = $certificate  = $null
            try {
                #We will get an error if the server resolves but is off-line - catch it - we will close whatever was opened and output whatever info we have
                $tcpclient     = [Sockets.TcpClient]::new($hostName,$port)
                $Stream        = $tcpclient.GetStream()
                $sslstream     = [Security.SslStream]::new($Stream, $false, {$true})
                $sslstream.AuthenticateAsClient($hostname)
                $certificate   = $sslstream.RemoteCertificate
            }
            catch {}
            if ($sslstream)        {$sslstream.close() }
	    if ($stream)           {$stream.close()    }
            if ($tcpClient)        {$tcpClient.close() }

It's annoying, but it's not a PowerShell thing, and .NET is unlikely to change back to the old behaviour.

If you're just looking to get the cert creation and expiration here's a function I wrote that works in both PoSH 7 and 5.1.
  function Get-CertExpiration {
    [cmdletbinding()]
    Param (
      [Parameter(Mandatory = $true, ValueFromPipeline = $true)]
      [Alias('IP')]
      [string[]]$URL,
      [int]$Port = 443
    )

    Try {
      $TCPClient = New-Object -TypeName System.Net.Sockets.TCPClient

      $TcpSocket = New-Object -TypeName Net.Sockets.TcpClient -ArgumentList ($URL, $Port)
      $tcpstream = $TcpSocket.GetStream()
      $Callback = { param($sender, $Cert, $chain, $errors) return $true }
      $SSLStream = New-Object -TypeName System.Net.Security.SSLStream -ArgumentList @($tcpstream, $true, $Callback)
      $SSLStream.AuthenticateAsClient($URL, $null, 'tls12', $false)
      $Certificate = New-Object -TypeName System.Security.Cryptography.X509Certificates.X509Certificate2 -ArgumentList ($SSLStream.RemoteCertificate)
    }
    Catch {
      $TCPClient = New-Object -TypeName System.Net.Sockets.TCPClient

      $TcpSocket = New-Object -TypeName Net.Sockets.TcpClient -ArgumentList ($URL, $Port)
      $tcpstream = $TcpSocket.GetStream()
      $Callback = { param($sender, $Cert, $chain, $errors) return $true }
      $SSLStream = New-Object -TypeName System.Net.Security.SSLStream -ArgumentList @($tcpstream, $true, $Callback)
      $SSLStream.AuthenticateAsClient($URL, $null, 'tls', $false)
      $Certificate = New-Object -TypeName System.Security.Cryptography.X509Certificates.X509Certificate2 -ArgumentList ($SSLStream.RemoteCertificate)
    }
    Finally {
      $SSLStream.Dispose()
      $TCPClient.Dispose()
    }

    Return $Certificate
  }

Some backstory:

https://github.com/dotnet/runtime/issues/29301


text:
Bug - PowerShell displays an error when loading in Windows Terminal

Prerequisites

[X] Write a descriptive title.
[X] Make sure you are able to repro it on the latest released version
[X] Search the existing issues.
[X] Refer to the FAQ.
[X] Refer to Differences between Windows PowerShell 5.1 and PowerShell.

Steps to reproduce
I launched Windows Terminal, and expected to see PowerShell with no errors
Launched from Windows Terminal
Expected behavior
An error has occurred that was not properly handled. Additional information is shown below. The PowerShell process will
exit .

Actual behavior
An error has occurred that was not properly handled. Additional information is shown below. The PowerShell process will
exit .

Error details
An error has occurred that was not properly handled. Additional information is shown below. The PowerShell process will
exit .

Environment data
An error has occurred that was not properly handled. Additional information is shown below. The PowerShell process will
exit.

Visuals

It looks to be referring to WinGet which is not a module that is loaded by default. Try launching powershell without a profile: pwsh -noprofile. If that works then you need to take a look at the commands you've added to $profile.

@tomtaylor-kbg:
On a general note:

When  you file a bug report, please give it a descriptive title - "Bug" isn't helpful, as it conveys no additional information beyond choosing the "Bug report" template on creation of an issue.

Please fill in the sections of the issue template as prescribed - repeating the same information over and over isn't helpful.

Following this advice is much more likely to get your feedback to be taken seriously.

Thanks for your help

Thanks @tomtaylor-kbg for reporting this issue - it seems this is resolved. Please feel free to reopen or start a new issue if this was closed in error.


text:
Pwsh still corrupts environment variable on Linux Arm 64

Prerequisites

[X] Write a descriptive title.
[X] Make sure you are able to repro it on the latest released version
[X] Search the existing issues.
[X] Refer to the FAQ.
[X] Refer to Differences between Windows PowerShell 5.1 and PowerShell.

Steps to reproduce
use the following docker file building on a Linux Arm machine (I'm using AWS Graviton EC2)
FROM mcr.microsoft.com/dotnet/sdk:9.0.101-noble-${TARGETARCH}${TARGETVARIANT}
ARG TARGETPLATFORM
ARG TARGETARCH
ARG TARGETVARIANT
ARG BUILDVARIANT
ARG ARM64ORX64
RUN printf "I'm building for TARGETPLATFORM=${TARGETPLATFORM}" \
&& printf ", TARGETVARIANT=${TARGETVARIANT}" \
&& printf ", TARGETARCH=${TARGETARCH}" \
&& printf ", BUILDVARIANT=${BUILDVARIANT} \n" \
&& printf ", ARM64ORX64=${ARM64ORX64} \n" \
    && printf "With uname -s : " && uname -s \
    && printf "and  uname -m : " && uname -m

RUN pwsh
RUN pwsh --version
RUN which pwsh
RUN echo $PATH
RUN ls -l /usr/bin/pwsh
RUN pwsh -Command 'Write-Host ${env:PSHOME}'
RUN pwsh -Command 'Write-Host ${env:PATH}'
RUN pwsh -Command 'pwsh -EncodedCommand VwByAGkAdABlAC0ASABvAHMAdAAgACcAaABlAGwAbABvACcA'

and the following Exec format error is output
 > [10/10] RUN pwsh -Command 'pwsh -EncodedCommand VwByAGkAdABlAC0ASABvAHMAdAAgACcAaABlAGwAbABvACcA':

[2024-12-18T13:30:25.569Z] 1.392 ResourceUnavailable: Program 'pwsh' failed to run: An error occurred trying to start process '/usr/share/powershell/.store/powershell.linux.arm64/7.5.0-preview.5/powershell.linux.arm64/7.5.0-preview.5/tools/net9.0/any/pwsh' with working directory '/'. Exec format errorAt line:1 char:1
Full docker output : dockerlog.txt
this was originally raised via Issue https://github.com/PowerShell/PowerShell/issues/24090 and I thought this was resolved in PR https://github.com/PowerShell/PowerShell/pull/24228
Expected behavior
[2024-12-18T13:27:43.017Z] #13 [10/10] RUN pwsh -Command 'pwsh -EncodedCommand VwByAGkAdABlAC0ASABvAHMAdAAgACcAaABlAGwAbABvACcA'

should output "hello"

Actual behavior
[2024-12-18T13:30:25.569Z] #13 1.392 ResourceUnavailable: Program 'pwsh' failed to run: An error occurred trying to start process '/usr/share/powershell/.store/powershell.linux.arm64/7.5.0-preview.5/powershell.linux.arm64/7.5.0-preview.5/tools/net9.0/any/pwsh' with working directory '/'. Exec format errorAt line:1 char:1

Error details
No response
Environment data
RUN pwsh $PSVersionTable

[2024-12-19T10:04:36.769Z] #11 0.636 PowerShell 7.5.0-preview.5

Visuals
No response

The problem seems to be that in your case the path contains the following segment:
/.store/powershell.linux.arm64/
whereas the fix in https://github.com/PowerShell/PowerShell/pull/24228/files is in effect looking for:
/.store/powershell/


text:
Complete breaks when file starts with period

From @Aetylus on August 12, 2016 13:12
The Complete function (using Set-PSReadlineKeyHandler -Key Tab -Function Complete) doesn't seem to handle files with similar names but one begins with a period. I do a lot of work in gVim while on Windows which will leave .[filename].swp files while open, and attempting to tab complete the filename results in PowerShell completely unwriting the whole word.
Take for example a directory with .foo.bar and foo.bar. If you have ii f, ii fo or ii foo and attempt tab complete, it will completely rewrite your line to ii .\. Same with ii .\f, ii .\fo, and ii .\foo. Once you include the period before the file extension, it will autocomplete to ii .\foo.bar.
Copied from original issue: lzybkr/PSReadLine#415

https://github.com/PowerShell/PowerShell/issues/4694

authors: SteveL-MSFT lzybkr


text:
Does powershell support Termux?

Best that I can tell, Termux does two things:

terminal for Android - you should be able to use this to ssh to another machine and run PowerShell
Linux environment based on Debian/Ubuntu for Android - perhaps you can try the generic linux.tar.gz pkg we build and see if it works?

@SteveL-MSFT  thanks！Is Powershell for linux a GUI program?

@myfreess no, PowerShell is a shell and thus works in the console

I can't execute it, can anyone help?
$ ls -l pwsh -rwxrwxrwx    1 u0_a67   u0_a67       77172 Nov 14 05:08 pwsh $ readelf -h ./pwsh ELF Header:   Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00   Class:                             ELF32   Data:                              2's complement, little endian   Version:                           1 (current)   OS/ABI:                            UNIX - System V   ABI Version:                       0   Type:                              EXEC (Executable file)   Machine:                           ARM   Version:                           0x1   Entry point address:               0xfb9d   Start of program headers:          52 (bytes into file)   Start of section headers:          75972 (bytes into file)   Flags:                             0x5000402, Version5 EABI, hard-float ABI, <unknown>   Size of this header:               52 (bytes)   Size of program headers:           32 (bytes)   Number of program headers:         9   Size of section headers:           40 (bytes)   Number of section headers:         30   Section header string table index: 29 $ ls -l ./pwsh -rwxrwxrwx    1 u0_a67   u0_a67       77172 Nov 14 05:08 ./pwsh $ ./pwsh bash: ./pwsh: No such file or directory $

If anyone's interested, this is indeed possible:
https://github.com/termux/termux-packages/issues/1729

I've heard PowerShell works within https://github.com/CypherpunkArmory/UserLAnd

authors: CtrlShiftEscape DRSDavidSoft SteveL-MSFT myfreess


text:
Add missing PSToken entries

Fixes https://github.com/PowerShell/PowerShell/issues/13462.
The token entries in PSParser are out of date and need to be updated.
We should continue tracking work after this PR is merged to test this API to prevent future regressions.

PR Context

PR Checklist

[x] PR has a meaningful title

Use the present tense and imperative mood when describing your changes

[x] Summarized changes
[x] Make sure all .h, .cpp, .cs, .ps1 and .psm1 files have the correct copyright header
[x] This PR is ready to merge and is not Work in Progress.

If the PR is work in progress, please add the prefix WIP: or [ WIP ] to the beginning of the title (the WIP bot will keep its status check at Pending while the prefix is present) and remove the prefix when the PR is ready.

Breaking changes

[x] None
OR
[ ] Experimental feature(s) needed

[ ] Experimental feature name(s):

User-facing changes

[x] Not Applicable
OR
[ ] Documentation needed

[ ] Issue filed:

Testing - New and feature

[ ] N/A or can only be tested interactively
OR
[ ] Make sure you've added a new test if existing tests do not effectively test the code changed

Tooling

[x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted.
OR
[ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include:

Impact on PowerShell Editor Services which is used in the PowerShell extension for VSCode (which runs in a different PS Host).
Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features.
Impact on PSScriptAnalyzer (which provides linting & formatting in the editor extensions).
Impact on EditorSyntax (which provides syntax highlighting with in VSCode, GitHub, and many other editors).

As for test, we could add temporary internal static method to check a consistency of s_tokenKindMapping and other static mappings in xUnit test.

authors: iSazonov rjmholt


text:
Use IL assemblies for NuGet packages to reduce size

PR Summary
The framework dependent build, builds IL assemblies. This PR uses those assemblies to build the packages. This drastically reduces the nuget package size.
PR Context

PR Checklist

[x] PR has a meaningful title

Use the present tense and imperative mood when describing your changes

[x] Summarized changes
[x] Change is not breaking
[x] Make sure all .h, .cpp, .cs, .ps1 and .psm1 files have the correct copyright header
[x] This PR is ready to merge and is not Work in Progress.

If the PR is work in progress, please add the prefix WIP: or [ WIP ] to the beginning of the title (the WIP bot will keep its status check at Pending while the prefix is present) and remove the prefix when the PR is ready.

User-facing changes

[x] Not Applicable
OR
[ ] Documentation needed

[ ] Issue filed:

Testing - New and feature

[x] N/A or can only be tested interactively
OR
[ ] Make sure you've added a new test if existing tests do not effectively test the code changed

[ ] Add [feature] to your commit messages if the change is significant or affects feature tests

/cc @TylerLeonhardt

authors: adityapatwardhan daxian-dbw


text:
Update-Module does not really update the module

Update-Module only installs a newer version. It does not remove the previous version. This is no different that using Install-Module except that it checks the current installed version an searches for a newer version. That search functionality would be better implemented as a -Update parameter for Install-Module.
Expected Behavior
Update-Module should replace the current version with a new version. Not install the new version side-by-side with the old version.
Possible Solutions

Deprecate Update-Module and move the search for update functionality into Install-Module.
Change Update-Module to remove the old version. This needs to be smart enough to remove all old versions of nested modules without breaking dependencies in other installed modules.

Context
Using the verb Update is confusing to customers. They expect the cmdlet to update what they have not install side-by-side. Also, the cmdlet reference does not explain this behavior.
We see this a lot with Azure PowerShell. They release a new version every month. After a few months you can have several versions installed taking up a lot of space.
Your Environment
PS C:\Git>  $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.15063.296
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.15063.296
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

PS C:\Git>  Get-Module

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     0.0        chocolateyProfile                   {TabExpansion, Update-SessionEnvironment, refreshenv}
Manifest   3.1.0.0    Microsoft.PowerShell.Management     {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Cont...
Manifest   3.1.0.0    Microsoft.PowerShell.Utility        {Add-Member, Add-Type, Clear-Variable, Compare-Object...}
Script     0.7.0      posh-git                            {Add-PoshGitToProfile, Add-SshKey, Enable-GitColors, Get-Al...
Script     1.2        PSReadline                          {Get-PSReadlineKeyHandler, Get-PSReadlineOption, Remove-PSR...
Script     1.0.0.1    PSYaml                              {Convert-YAMLtoJSON, ConvertFrom-YAML, ConvertFrom-YAMLDocu...
Script     1.0        sdwheeler.utilities                 {close-SQLite, ConvertFrom-Base64, convertfrom-htmlencoding...

PS C:\Git>  Get-Module -ListAvailable PowerShellGet,PackageManagement

    Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     1.1.3.0    PackageManagement                   {Find-Package, Get-Package, Get-PackageProvider, Get-Packag...
Binary     1.0.0.1    PackageManagement                   {Find-Package, Get-Package, Get-PackageProvider, Get-Packag...
Script     1.1.2.0    PowerShellGet                       {Install-Module, Find-Module, Save-Module, Update-Module...}
Script     1.0.0.1    PowerShellGet                       {Install-Module, Find-Module, Save-Module, Update-Module...}

PS C:\Git>  Get-PackageProvider

Name                     Version          DynamicOptions
----                     -------          --------------
msi                      3.0.0.0          AdditionalArguments
msu                      3.0.0.0
NuGet                    2.8.5.207        Destination, ExcludeVersion, Scope, SkipDependencies, Headers, FilterOnTag,...
PowerShellGet            1.1.2.0          PackageManagementProvider, Type, Scope, AllowClobber, SkipPublisherCheck, I...
Programs                 3.0.0.0          IncludeWindowsInstaller, IncludeSystemComponent

PS C:\Git>  Get-PackageProvider -ListAvailable

Name                     Version          DynamicOptions
----                     -------          --------------
msi                      3.0.0.0          AdditionalArguments
msu                      3.0.0.0
NuGet                    2.8.5.207        Destination, ExcludeVersion, Scope, SkipDependencies, Headers, FilterOnTag,...
PowerShellGet            1.1.2.0          PackageManagementProvider, Type, Scope, AllowClobber, SkipPublisherCheck, I...
PowerShellGet            1.0.0.1
Programs                 3.0.0.0          IncludeWindowsInstaller, IncludeSystemComponent

@SydneyhSmith / @SteveL-MSFT  if this issue is not completed before PSGet 3.0 GA will it be a breaking change?

@ThomasNieto for 3.0 we are maintaining the behavior of Update, to install the latest version, and not delete older versions... since this has always been the behavior of PowerShellGet this will not be a change...in the future we may address this feature request by adding a parameter to the Update cmdlet that specifies older versions of the module should be uninstalled

| Assert-Duplicate -Near -Fuzzy $_ #581

@ThomasNieto for 3.0 we are maintaining the behavior of Update, to install the latest version, and not delete older versions... since this has always been the behavior of PowerShellGet this will not be a change...in the future we may address this feature request by adding a parameter to the Update cmdlet that specifies older versions of the module should be uninstalled

Would it be possible to change this so that Update-Module does update by default, and install side-by-side when a parameter is added?
I'd argue that the expected behaviour of any update mechanism is to replace the old version with the new one, so this should also be the default for PSGet 3

@danielniccoli have you read the discussion of that over in #581?

authors: SydneyhSmith ThomasNieto danielniccoli no-identd sdwheeler

repo: PowerShell/PowerShellGet


text:
PSScriptInfo : the content of the field 'description' do not support the French alphabet

This string :
Remplace toutes les occurrences d'un modèle de caractère

is converted into :
Remplace toutes les occurrences d'un mod�le de caract�re

The content of the field 'description' is incorrect :
https://www.myget.org/feed/ottomatt/package/nuget/Edit-String
The PSScriptInfo datas :
<#PSScriptInfo
.VERSION 1.3.0
.GUID 9fcc3ac5-5135-4c0c-bed3-f0e8e7aedb84
.AUTHOR Laurent Dardenne
.COMPANYNAME
.COPYRIGHT CopyLeft
.TAGS Replace Regex Template String Edit
.LICENSEURI https://creativecommons.org/licenses/by-nc-sa/4.0
.PROJECTURI https://github.com/LaurentDardenne/ProjectTools
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES 22 août 2010
.DESCRIPTION  Remplace toutes les occurrences d'un modèle de caractère, défini par une chaîne de caractère simple ou par une expression régulière, par une chaîne de caractères de remplacement.
#>

Windows Seven
Powershell v 5.0.10586.117
PackageManagement 1.1.0.0

This is happening due to default ANSII encoding of the .nuspec file created using Set-Content cmdlet. We will have to use the Out-File cmdlet to create the .nuspec file during publish operation, here Unicode is the default encoding.

Thank you.

authors: LaurentDardenne bmanikm


text:
Rename improperly named functions, and add comment based help in MSFT…_xExchExchangeServer and MSFT_xExchImapSettings.

Pull Request (PR) description
Rename improperly named functions, and add comment based help in MSFT…_xExchExchangeServer and MSFT_xExchImapSettings.
This Pull Request (PR) fixes the following issues

Fixes #291
Fixes #292

Task list

[x] Added an entry under the Unreleased section of the change log in the CHANGELOG.md.
Entry should say what was changed, and how that affects users (if applicable).
[x] Resource documentation added/updated in README.md.
[x] Resource parameter descriptions added/updated in README.md, schema.mof
and comment-based help.
[x] Comment-based help added/updated.
[ ] Localization strings added/updated in all localization files as appropriate.
[ ] Examples appropriately added/updated.
[x] Unit tests added/updated. See DSC Resource Testing Guidelines.
[ ] Integration tests added/updated (where possible). See DSC Resource Testing Guidelines.
[x] New/changed code adheres to DSC Resource Style Guidelines and Best Practices.

This change is

Codecov Report

Merging #346 into dev will not change coverage.
The diff coverage is 40%.

@@           Coverage Diff           @@
##              dev     #346   +/-   ##
=======================================
  Coverage   32.22%   32.22%
=======================================
  Files          39       39
  Lines        4671     4671
=======================================
  Hits         1505     1505
  Misses       3166     3166

Impacted Files
Coverage Δ

..._xExchExchangeServer/MSFT_xExchExchangeServer.psm1
30.64% <33.33%> (ø)
:arrow_up:

...MSFT_xExchImapSettings/MSFT_xExchImapSettings.psm1
30.55% <50%> (ø)
:arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b4ed91b...19f473e. Read the comment docs.

Requesting community code review.

authors: codecov-io mhendric

repo: PowerShell/xExchange


text:
xFailOverCluster: Fixed failing tests in AppVeyor

Changes to xClusterPreferredOwner

Script Analyzer warnings have been fixed (issue #50). This also failed the tests for the resource.

Changes to xClusterDisk

Fixed test that was failing in  AppVeyor (issue #55).

This change is

@johlju,
Thanks for having already signed the Contribution License Agreement. Your agreement was validated by Microsoft. We will now review your pull request.
Thanks,
Microsoft Pull Request Bot

@bgelens If you have time to review this one. This fixes the tests failing in AppVeyor. Unfortunately the files contained a lot of spaces where there shouldn't so VSCode trimmed them. So there are more changes than I wanted. :/

Some minor comments since you are on a roll already ;)

Reviewed 3 of 3 files at r1.
Review status: all files reviewed at latest revision, 9 unresolved discussions.

DSCResources/MSFT_xClusterPreferredOwner/MSFT_xClusterPreferredOwner.psm1, line 40 at r1 (raw file):

        Write-Verbose -Message "Retrieving Owner information for Cluster Group $ClusterGroup"
        (((Get-ClusterGroup -cluster $Clustername)| Where-Object {$_.name -like "$ClusterGroup"} | Get-ClusterOwnerNode).ownernodes).name

Parameter ClusterName has been fixed with correct PascalCase. Now the variable needs to fixed as well

DSCResources/MSFT_xClusterPreferredOwner/MSFT_xClusterPreferredOwner.psm1, line 47 at r1 (raw file):

            {
                Write-Verbose -Message "Retrieving Owner information for Cluster Resource $resource"
                (((Get-ClusterResource -cluster $Clustername)| Where-Object {$_.name -like "$resource"} | Get-ClusterOwnerNode).ownernodes).name

ClusterName

DSCResources/MSFT_xClusterPreferredOwner/MSFT_xClusterPreferredOwner.psm1, line 55 at r1 (raw file):

    $returnValue = @{
        ClusterGroup = $ClusterGroup
        Clustername = $Clustername

ClusterName

DSCResources/MSFT_xClusterPreferredOwner/MSFT_xClusterPreferredOwner.psm1, line 190 at r1 (raw file):

    if ($Ensure -eq 'Present')
        {

Please correct indentation where applicable like here

DSCResources/MSFT_xClusterPreferredOwner/MSFT_xClusterPreferredOwner.psm1, line 210 at r1 (raw file):

    if ($Ensure -eq 'Absent')
        {

and here

Tests/MSFT_xClusterDisk.Tests.ps1, line 87 at r1 (raw file):

        Mock -CommandName 'Get-ClusterParameter' -ParameterFilter { $Name -eq 'DiskIdGuid' } -MockWith {
            #write-host $args.count -ForegroundColor Cyan

these can me removed I think

Tests/MSFT_xClusterDisk.Tests.ps1, line 88 at r1 (raw file):

        Mock -CommandName 'Get-ClusterParameter' -ParameterFilter { $Name -eq 'DiskIdGuid' } -MockWith {
            #write-host $args.count -ForegroundColor Cyan
            #write-host $args -ForegroundColor Cyan

these can me removed I think

Tests/MSFT_xClusterDisk.Tests.ps1, line 107 at r1 (raw file):

            It 'Returns a [System.Collection.Hashtable] type' {

Empty lines can be removed when they make not a lot of sense (multiple occasions, won't repeat remark)

Tests/MSFT_xClusterDisk.Tests.ps1, line 121 at r1 (raw file):

                $Result.Label  | Should Be $TestParameter.Label

                $Result -is [System.Collections.Hashtable] | Should Be $true

Not sure why this same test is in every It?

Comments from Reviewable

Well, since I'm on a roll I fixed more style issues. :wink:
There is more to be done, but don't want to do too much at once.

Review status: 1 of 3 files reviewed at latest revision, 9 unresolved discussions.

DSCResources/MSFT_xClusterPreferredOwner/MSFT_xClusterPreferredOwner.psm1, line 40 at r1 (raw file):
Previously, bgelens (Ben Gelens) wrote…
Parameter ClusterName has been fixed with correct PascalCase. Now the variable needs to fixed as well

Done.

DSCResources/MSFT_xClusterPreferredOwner/MSFT_xClusterPreferredOwner.psm1, line 47 at r1 (raw file):
Previously, bgelens (Ben Gelens) wrote…
ClusterName

Done.

DSCResources/MSFT_xClusterPreferredOwner/MSFT_xClusterPreferredOwner.psm1, line 55 at r1 (raw file):
Previously, bgelens (Ben Gelens) wrote…
ClusterName

Done.

DSCResources/MSFT_xClusterPreferredOwner/MSFT_xClusterPreferredOwner.psm1, line 190 at r1 (raw file):
Previously, bgelens (Ben Gelens) wrote…
Please correct indentation where applicable like here

Done.

DSCResources/MSFT_xClusterPreferredOwner/MSFT_xClusterPreferredOwner.psm1, line 210 at r1 (raw file):
Previously, bgelens (Ben Gelens) wrote…
and here

Done.

Tests/MSFT_xClusterDisk.Tests.ps1, line 87 at r1 (raw file):
Previously, bgelens (Ben Gelens) wrote…
these can me removed I think

Done.

Tests/MSFT_xClusterDisk.Tests.ps1, line 88 at r1 (raw file):
Previously, bgelens (Ben Gelens) wrote…
these can me removed I think

Done.

Tests/MSFT_xClusterDisk.Tests.ps1, line 107 at r1 (raw file):
Previously, bgelens (Ben Gelens) wrote…
Empty lines can be removed when they make not a lot of sense (multiple occasions, won't repeat remark)

Done.

Tests/MSFT_xClusterDisk.Tests.ps1, line 121 at r1 (raw file):
Previously, bgelens (Ben Gelens) wrote…
Not sure why this same test is in every It?

Done. Cleaned up those. I think we need to look over these tests a bit later, because they are a combination of unit tests and integration tests. We can do that when we have added CodeCov. I'm hoping to do that this weekend.

Comments from Reviewable

 Well done sir!

Reviewed 2 of 2 files at r2.
Review status: all files reviewed at latest revision, all discussions resolved.

Comments from Reviewable

authors: bgelens johlju msftclas

repo: PowerShell/xFailOverCluster


text:
xArchive doesn't calculate cache hash code correctly - race condition when multiple archives in one configuration

Get-CacheEntry calculates a cache key using:
$key = [string]::Join($args).GetHashCode().ToString()

Unfortuntaely, [string]::Join requires the separator as the first argument, so this will always result in calculating the hash code of the empty string - or 371857150.
If you have multiple archives in the same configuration, they will all get cached to the same key - sometimes this isn't a problem, sometimes it is - it's unpredictable, and seems to depend on random timing of some parallel activities.
The fix is simple:
$key = [string]::Join(';', $args).GetHashCode().ToString()

Note - the same bug applies to the default "Archive" DSC resource.

See PR #17

Fixed by #17

authors: KarolKaczmarek chrissimon-au

repo: PowerShell/xPSDesiredStateConfiguration


text:
Enable CodeCov.io and fix breaks

This change is

Codecov Report

:exclamation: No coverage uploaded for pull request base (dev@47ad05d). Click here to learn what that means.
The diff coverage is n/a.

@@         Coverage Diff          @@
##             dev   #320   +/-   ##
====================================
  Coverage       ?    60%
====================================
  Files          ?     24
  Lines          ?   3635
  Branches       ?      4
====================================
  Hits           ?   2205
  Misses         ?   1426
  Partials       ?      4

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 47ad05d...dde4b10. Read the comment docs.

@TravisEz13 Any idea why this update is crashing a bunch of different tests? Are the new common tests using a special strict mode or a crazy scope or something?

@kwirkykat Not sure.  I rebased to your latest changes to make sure it wasn't fixed by one of those.

@TravisEz13 @kwirkykat When using the new appveyor model in xSQLServer I had to change so it imports the cmdlet stubs (mocked SQLPS module) using -Global as @TravisEz13 did in the User resource. But only when the tests are inside InModuleScope as far as I have seen. So the scope has changed in some way.

This is dependent on https://github.com/PowerShell/DscResource.Tests/pull/125.  Please do not merge until this has been changed and I have removed the commits to clone or pull the private branch.

@kwirkykat @mbreakey3 Can one of you take a look?

Reviewed 1 of 2 files at r1, 1 of 1 files at r2, 1 of 2 files at r3.
Review status: 3 of 4 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.

appveyor.yml, line 9 at r3 (raw file):

$mainModuleFolder = "."

Also why not use $PSScriptRoot?

appveyor.yml, line 10 at r3 (raw file):

Import-Module "$env:APPVEYOR_BUILD_FOLDER\DscResource.Tests\AppVeyor.psm1"

Unnamed parameter (add -Name)

Comments from Reviewable

Review status: 3 of 4 files reviewed at latest revision, 2 unresolved discussions.

appveyor.yml, line 9 at r3 (raw file):
Previously, kwirkykat (Katie Keim) wrote…

$mainModuleFolder = "."

Also why not use $PSScriptRoot?

There won't be a $PSScriptRoot unless we run a script (.ps1 or .psm1)

appveyor.yml, line 10 at r3 (raw file):
Previously, kwirkykat (Katie Keim) wrote…

Import-Module "$env:APPVEYOR_BUILD_FOLDER\DscResource.Tests\AppVeyor.psm1"

Unnamed parameter (add -Name)

Done

Comments from Reviewable

Review status: 3 of 4 files reviewed at latest revision, 2 unresolved discussions.

appveyor.yml, line 9 at r3 (raw file):
Previously, TravisEz13 (Travis Plunk) wrote…
There won't be a $PSScriptRoot unless we run a script (.ps1 or .psm1)

Removed it since the default is the same.

Comments from Reviewable

Reviewed 1 of 1 files at r4.
Review status: all files reviewed at latest revision, all discussions resolved.

Comments from Reviewable

authors: TravisEz13 codecov-io johlju kwirkykat


text:
Development build nuget packages aren't properly formed

Repro:
register-psrepository -Name xSharePointDev -SourceLocation https://ci.appveyor.com/nuget/xSharePoint
install-module -name xSharePoint -Repository xSharePointDev -RequiredVersion 0.12.673.0

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from
'xSharePointDev'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): y
WARNING: The module 'xSharePoint' cannot be installed or updated because it is not a properly-formed module.

I confirmed development builds for other modules (xWebAdministration, xExchange) can be installed properly, so the problem must be with the way nupkg is generated for xSharePoint

Thanks for reporting @KarolKaczmarek - I'm on it

@KarolKaczmarek This looks ok from my end now, can you confirm before I close this off?

sorry for the delay, but I just tried it and works now. Thanks!

authors: BrianFarnhill KarolKaczmarek

repo: PowerShell/xSharePoint